]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
io_uring: signal SQPOLL task_work with TWA_SIGNAL_NO_IPI
authorJens Axboe <axboe@kernel.dk>
Tue, 25 Jun 2024 01:07:18 +0000 (19:07 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 5 Jul 2024 07:38:15 +0000 (09:38 +0200)
commit dbcabac138fdfc730ba458ed2199ff1f29a271fc upstream.

Before SQPOLL was transitioned to managing its own task_work, the core
used TWA_SIGNAL_NO_IPI to ensure that task_work was processed. If not,
we can't be sure that all task_work is processed at SQPOLL thread exit
time.

Fixes: af5d68f8892f ("io_uring/sqpoll: manage task_work privately")
Cc: stable@vger.kernel.org
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
io_uring/io_uring.c

index 8a216b1d6dc1cf5447863e9e0f64e74273eccff5..d3926a27714e2afd0b61940b78157e401a91886c 100644 (file)
@@ -1374,8 +1374,8 @@ static void io_req_normal_work_add(struct io_kiocb *req)
        if (ctx->flags & IORING_SETUP_SQPOLL) {
                struct io_sq_data *sqd = ctx->sq_data;
 
-               if (wq_has_sleeper(&sqd->wait))
-                       wake_up(&sqd->wait);
+               if (sqd->thread)
+                       __set_notify_signal(sqd->thread);
                return;
        }