|
5 | 5 |
|
6 | 6 | static struct callback_head work_exited; /* all we need is ->next == NULL */
|
7 | 7 |
|
8 |
| -/* |
9 |
| - * TWA_SIGNAL signaling - use TIF_NOTIFY_SIGNAL, if available, as it's faster |
10 |
| - * than TIF_SIGPENDING as there's no dependency on ->sighand. The latter is |
11 |
| - * shared for threads, and can cause contention on sighand->lock. Even for |
12 |
| - * the non-threaded case TIF_NOTIFY_SIGNAL is more efficient, as no locking |
13 |
| - * or IRQ disabling is involved for notification (or running) purposes. |
14 |
| - */ |
15 |
| -static void task_work_notify_signal(struct task_struct *task) |
16 |
| -{ |
17 |
| -#if defined(TIF_NOTIFY_SIGNAL) |
18 |
| - set_notify_signal(task); |
19 |
| -#else |
20 |
| - unsigned long flags; |
21 |
| - |
22 |
| - /* |
23 |
| - * Only grab the sighand lock if we don't already have some |
24 |
| - * task_work pending. This pairs with the smp_store_mb() |
25 |
| - * in get_signal(), see comment there. |
26 |
| - */ |
27 |
| - if (!(READ_ONCE(task->jobctl) & JOBCTL_TASK_WORK) && |
28 |
| - lock_task_sighand(task, &flags)) { |
29 |
| - task->jobctl |= JOBCTL_TASK_WORK; |
30 |
| - signal_wake_up(task, 0); |
31 |
| - unlock_task_sighand(task, &flags); |
32 |
| - } |
33 |
| -#endif |
34 |
| -} |
35 |
| - |
36 | 8 | /**
|
37 | 9 | * task_work_add - ask the @task to execute @work->func()
|
38 | 10 | * @task: the task which should run the callback
|
@@ -76,7 +48,7 @@ int task_work_add(struct task_struct *task, struct callback_head *work,
|
76 | 48 | set_notify_resume(task);
|
77 | 49 | break;
|
78 | 50 | case TWA_SIGNAL:
|
79 |
| - task_work_notify_signal(task); |
| 51 | + set_notify_signal(task); |
80 | 52 | break;
|
81 | 53 | default:
|
82 | 54 | WARN_ON_ONCE(1);
|
|
0 commit comments