summary refs log tree commit diff
path: root/fs/io-wq.c
diff options
context:
space:
mode:
authorEric W. Biederman <ebiederm@xmission.com>2022-02-09 11:18:54 -0600
committerEric W. Biederman <ebiederm@xmission.com>2022-03-10 16:51:50 -0600
commit7c5d8fa6fbb12a3f0eefe8762bfede508e147cb3 (patch)
tree0abadafb76c2719b1632ae452a228909669edef3 /fs/io-wq.c
parent8ba62d37949e248c698c26e0d82d72fda5d33ebf (diff)
downloadlinux-7c5d8fa6fbb12a3f0eefe8762bfede508e147cb3.tar.gz
task_work: Decouple TIF_NOTIFY_SIGNAL and task_work
There are a small handful of reasons besides pending signals that the
kernel might want to break out of interruptible sleeps.  The flag
TIF_NOTIFY_SIGNAL and the helpers that set and clear TIF_NOTIFY_SIGNAL
provide that the infrastructure for breaking out of interruptible
sleeps and entering the return to user space slow path for those
cases.

Expand tracehook_notify_signal inline in it's callers and remove it,
which makes clear that TIF_NOTIFY_SIGNAL and task_work are separate
concepts.

Update the comment on set_notify_signal to more accurately describe
it's purpose.

Reviewed-by: Kees Cook <keescook@chromium.org>
Link: https://lkml.kernel.org/r/20220309162454.123006-9-ebiederm@xmission.com
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
Diffstat (limited to 'fs/io-wq.c')
-rw-r--r--fs/io-wq.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/io-wq.c b/fs/io-wq.c
index bb7f161bb19c..8b9147873c2c 100644
--- a/fs/io-wq.c
+++ b/fs/io-wq.c
@@ -515,7 +515,9 @@ static bool io_flush_signals(void)
 {
 	if (unlikely(test_thread_flag(TIF_NOTIFY_SIGNAL))) {
 		__set_current_state(TASK_RUNNING);
-		tracehook_notify_signal();
+		clear_notify_signal();
+		if (task_work_pending(current))
+			task_work_run();
 		return true;
 	}
 	return false;