mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] io_uring/io-wq: don't call try_to_wake_up() twice in io_wq_worker_wake()
@ 2026-10-11 15:13 Oleg Nesterov
  2026-10-12  8:38 ` Christian Brauner
  2026-10-12 18:51 ` Jens Axboe
  0 siblings, 2 replies; 3+ messages in thread
From: Oleg Nesterov @ 2026-10-11 15:13 UTC (permalink / raw)
  To: Jens Axboe; +Cc: Christian Brauner, Pavel Begunkov, io-uring, linux-kernel

io_wq_worker_wake() does an unconditional wake_up_process(). This means
that __set_notify_signal() makes no real sense. Change it to use
set_tsk_thread_flag(TIF_NOTIFY_SIGNAL) instead to avoid test_and_set_bit()
and another wake_up_state(TASK_INTERRUPTIBLE) if NOTIFY_SIGNAL was not set.

Perhaps io_wq_worker_wake() can rely on __set_notify_signal() solely, but I
don't understand this code enough and this patch doesn't change the current
behaviour.

Signed-off-by: Oleg Nesterov <oleg@redhat.com>
---
 io_uring/io-wq.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/io_uring/io-wq.c b/io_uring/io-wq.c
index 2ca223e47d41..eb90961f32d8 100644
--- a/io_uring/io-wq.c
+++ b/io_uring/io-wq.c
@@ -972,7 +972,7 @@ static void io_wq_for_each_worker(struct io_wq *wq,
 
 static bool io_wq_worker_wake(struct io_worker *worker, void *data)
 {
-	__set_notify_signal(worker->task);
+	set_tsk_thread_flag(worker->task, TIF_NOTIFY_SIGNAL);
 	wake_up_process(worker->task);
 	return false;
 }
-- 
2.55.0



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

* Re: [PATCH] io_uring/io-wq: don't call try_to_wake_up() twice in io_wq_worker_wake()
  2026-10-11 15:13 [PATCH] io_uring/io-wq: don't call try_to_wake_up() twice in io_wq_worker_wake() Oleg Nesterov
@ 2026-10-12  8:38 ` Christian Brauner
  2026-10-12 18:51 ` Jens Axboe
  1 sibling, 0 replies; 3+ messages in thread
From: Christian Brauner @ 2026-10-12  8:38 UTC (permalink / raw)
  To: Oleg Nesterov; +Cc: Jens Axboe, Pavel Begunkov, io-uring, linux-kernel

On Sun, Oct 11, 2026 at 05:13:16PM +0200, Oleg Nesterov wrote:
> io_wq_worker_wake() does an unconditional wake_up_process(). This means
> that __set_notify_signal() makes no real sense. Change it to use
> set_tsk_thread_flag(TIF_NOTIFY_SIGNAL) instead to avoid test_and_set_bit()
> and another wake_up_state(TASK_INTERRUPTIBLE) if NOTIFY_SIGNAL was not set.
> 
> Perhaps io_wq_worker_wake() can rely on __set_notify_signal() solely, but I
> don't understand this code enough and this patch doesn't change the current
> behaviour.
> 
> Signed-off-by: Oleg Nesterov <oleg@redhat.com>
> ---

Reviewed-by: Christian Brauner (Amutable) <brauner@kernel.org>

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

* Re: [PATCH] io_uring/io-wq: don't call try_to_wake_up() twice in io_wq_worker_wake()
  2026-10-11 15:13 [PATCH] io_uring/io-wq: don't call try_to_wake_up() twice in io_wq_worker_wake() Oleg Nesterov
  2026-10-12  8:38 ` Christian Brauner
@ 2026-10-12 18:51 ` Jens Axboe
  1 sibling, 0 replies; 3+ messages in thread
From: Jens Axboe @ 2026-10-12 18:51 UTC (permalink / raw)
  To: Oleg Nesterov; +Cc: Christian Brauner, Pavel Begunkov, io-uring, linux-kernel


On Sun, 11 Oct 2026 17:13:16 +0200, Oleg Nesterov wrote:
> io_wq_worker_wake() does an unconditional wake_up_process(). This means
> that __set_notify_signal() makes no real sense. Change it to use
> set_tsk_thread_flag(TIF_NOTIFY_SIGNAL) instead to avoid test_and_set_bit()
> and another wake_up_state(TASK_INTERRUPTIBLE) if NOTIFY_SIGNAL was not set.
> 
> Perhaps io_wq_worker_wake() can rely on __set_notify_signal() solely, but I
> don't understand this code enough and this patch doesn't change the current
> behaviour.
> 
> [...]

Applied, thanks!

[1/1] io_uring/io-wq: don't call try_to_wake_up() twice in io_wq_worker_wake()
      commit: e889b0e4cafddb3d68c3595dc01b7128fd35fbef

Best regards,
-- 
Jens Axboe




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

end of thread, other threads:[~2026-10-12 18:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-11 15:13 [PATCH] io_uring/io-wq: don't call try_to_wake_up() twice in io_wq_worker_wake() Oleg Nesterov
2026-10-12  8:38 ` Christian Brauner
2026-10-12 18: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

all inboxes | Powered by JetHome®