Skip to content

Commit

Permalink
kernel: remove checking for TIF_NOTIFY_SIGNAL
Browse files Browse the repository at this point in the history
It's available everywhere now, no need to check or add dummy defines.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
  • Loading branch information
Jens Axboe committed Dec 12, 2020
1 parent 98b89b6 commit e296dc4
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 12 deletions.
4 changes: 0 additions & 4 deletions include/linux/entry-common.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,6 @@
# define _TIF_UPROBE (0)
#endif

#ifndef _TIF_NOTIFY_SIGNAL
# define _TIF_NOTIFY_SIGNAL (0)
#endif

/*
* TIF flags handled in syscall_enter_from_user_mode()
*/
Expand Down
2 changes: 0 additions & 2 deletions include/linux/sched/signal.h
Original file line number Diff line number Diff line change
Expand Up @@ -360,15 +360,13 @@ static inline int task_sigpending(struct task_struct *p)

static inline int signal_pending(struct task_struct *p)
{
#if defined(TIF_NOTIFY_SIGNAL)
/*
* TIF_NOTIFY_SIGNAL isn't really a signal, but it requires the same
* behavior in terms of ensuring that we break out of wait loops
* so that notify signal callbacks can be processed.
*/
if (unlikely(test_tsk_thread_flag(p, TIF_NOTIFY_SIGNAL)))
return 1;
#endif
return task_sigpending(p);
}

Expand Down
4 changes: 0 additions & 4 deletions include/linux/tracehook.h
Original file line number Diff line number Diff line change
Expand Up @@ -205,24 +205,20 @@ static inline void tracehook_notify_resume(struct pt_regs *regs)
*/
static inline void tracehook_notify_signal(void)
{
#if defined(TIF_NOTIFY_SIGNAL)
clear_thread_flag(TIF_NOTIFY_SIGNAL);
smp_mb__after_atomic();
if (current->task_works)
task_work_run();
#endif
}

/*
* Called when we have work to process from exit_to_user_mode_loop()
*/
static inline void set_notify_signal(struct task_struct *task)
{
#if defined(TIF_NOTIFY_SIGNAL)
if (!test_and_set_tsk_thread_flag(task, TIF_NOTIFY_SIGNAL) &&
!wake_up_state(task, TASK_INTERRUPTIBLE))
kick_process(task);
#endif
}

#endif /* <linux/tracehook.h> */
2 changes: 0 additions & 2 deletions kernel/signal.c
Original file line number Diff line number Diff line change
Expand Up @@ -2535,14 +2535,12 @@ bool get_signal(struct ksignal *ksig)
* that the arch handlers don't all have to do it. If we get here
* without TIF_SIGPENDING, just exit after running signal work.
*/
#ifdef TIF_NOTIFY_SIGNAL
if (!IS_ENABLED(CONFIG_GENERIC_ENTRY)) {
if (test_thread_flag(TIF_NOTIFY_SIGNAL))
tracehook_notify_signal();
if (!task_sigpending(current))
return false;
}
#endif

if (unlikely(uprobe_deny_signal()))
return false;
Expand Down

0 comments on commit e296dc4

Please sign in to comment.