Skip to content

Commit 03941cc

Browse files
committed
task_work: remove legacy TWA_SIGNAL path
All archs now support TIF_NOTIFY_SIGNAL. Signed-off-by: Jens Axboe <[email protected]>
1 parent f50a705 commit 03941cc

File tree

1 file changed

+1
-29
lines changed

1 file changed

+1
-29
lines changed

kernel/task_work.c

Lines changed: 1 addition & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -5,34 +5,6 @@
55

66
static struct callback_head work_exited; /* all we need is ->next == NULL */
77

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-
368
/**
379
* task_work_add - ask the @task to execute @work->func()
3810
* @task: the task which should run the callback
@@ -76,7 +48,7 @@ int task_work_add(struct task_struct *task, struct callback_head *work,
7648
set_notify_resume(task);
7749
break;
7850
case TWA_SIGNAL:
79-
task_work_notify_signal(task);
51+
set_notify_signal(task);
8052
break;
8153
default:
8254
WARN_ON_ONCE(1);

0 commit comments

Comments
 (0)