summaryrefslogtreecommitdiff
path: root/io_uring
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2024-05-21 21:31:12 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-05-30 10:43:59 +0300
commitf812f6dfcd8dd7c0472522d3c1667327cb9bc041 (patch)
treed7f1d27b3eb238a2e37827f9fdc7351d9830c060 /io_uring
parent462043fb66b0d8687ae2c60630aae1f659e52eb1 (diff)
downloadlinux-f812f6dfcd8dd7c0472522d3c1667327cb9bc041.tar.xz
io_uring/sqpoll: ensure that normal task_work is also run timely
commit d13ddd9c893f0e8498526bf88c6b5fad01f0edd8 upstream. With the move to private task_work, SQPOLL neglected to also run the normal task_work, if any is pending. This will eventually get run, but we should run it with the private task_work to ensure that things like a final fput() is processed in a timely fashion. Cc: stable@vger.kernel.org Link: https://lore.kernel.org/all/313824bc-799d-414f-96b7-e6de57c7e21d@gmail.com/ Reported-by: Andrew Udvare <audvare@gmail.com> Fixes: af5d68f8892f ("io_uring/sqpoll: manage task_work privately") Tested-by: Christian Heusel <christian@heusel.eu> Tested-by: Andrew Udvare <audvare@gmail.com> Signed-off-by: Jens Axboe <axboe@kernel.dk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'io_uring')
-rw-r--r--io_uring/sqpoll.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/io_uring/sqpoll.c b/io_uring/sqpoll.c
index 3983708cef5b..158ab09c605b 100644
--- a/io_uring/sqpoll.c
+++ b/io_uring/sqpoll.c
@@ -238,11 +238,13 @@ static unsigned int io_sq_tw(struct llist_node **retry_list, int max_entries)
if (*retry_list) {
*retry_list = io_handle_tw_list(*retry_list, &count, max_entries);
if (count >= max_entries)
- return count;
+ goto out;
max_entries -= count;
}
-
*retry_list = tctx_task_work_run(tctx, max_entries, &count);
+out:
+ if (task_work_pending(current))
+ task_work_run();
return count;
}