public inbox for [email protected]
 help / color / mirror / Atom feed
* [PATCH] io_uring: Remove unneeded test in io_run_task_work_sig()
@ 2022-02-16 19:53 Olivier Langlois, Olivier Langlois
  2022-02-16 19:53 ` Olivier Langlois
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Olivier Langlois, Olivier Langlois @ 2022-02-16 19:53 UTC (permalink / raw)
  To: Jens Axboe; +Cc: Pavel Begunkov, io-uring, linux-kernel

Avoid testing TIF_NOTIFY_SIGNAL twice by calling task_sigpending()
directly from io_run_task_work_sig()

Signed-off-by: Olivier Langlois <[email protected]>
---
 fs/io_uring.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/fs/io_uring.c b/fs/io_uring.c
index 77b9c7e4793b..9b320b5f158c 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -7683,11 +7683,11 @@ static int io_run_task_work_sig(void)
 {
 	if (io_run_task_work())
 		return 1;
-	if (!signal_pending(current))
-		return 0;
 	if (test_thread_flag(TIF_NOTIFY_SIGNAL))
 		return -ERESTARTSYS;
-	return -EINTR;
+	if (task_sigpending(current))
+		return -EINTR;
+	return 0;
 }
 
 /* when returns >0, the caller should retry */
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-02-17 19:51 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-02-16 19:53 [PATCH] io_uring: Remove unneeded test in io_run_task_work_sig() Olivier Langlois, Olivier Langlois
2022-02-16 19:53 ` Olivier Langlois
2022-02-17 19:49 ` Olivier Langlois
2022-02-17 19:51 ` Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox