diff options
author | Pavel Begunkov <asml.silence@gmail.com> | 2021-09-08 16:40:53 +0100 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2021-10-19 05:49:52 -0600 |
commit | d97ec6239ad8684e4d31b12b39cefca6782c09a3 (patch) | |
tree | 1c97df68ddb81ce9e542e2995ee7d3a5bcbc108c /fs/io_uring.c | |
parent | c450178d9be9dc44327f3b526f82c36e4c5d362b (diff) | |
download | lwn-d97ec6239ad8684e4d31b12b39cefca6782c09a3.tar.gz lwn-d97ec6239ad8684e4d31b12b39cefca6782c09a3.zip |
io_uring: kill extra wake_up_process in tw add
TWA_SIGNAL already wakes the thread, no need in wake_up_process() after
it.
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/7e90cf643f633e857443e0c9e72471b221735c50.1631115443.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'fs/io_uring.c')
-rw-r--r-- | fs/io_uring.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/io_uring.c b/fs/io_uring.c index c4ec3672da77..ead85f4d3427 100644 --- a/fs/io_uring.c +++ b/fs/io_uring.c @@ -2197,8 +2197,9 @@ static void io_req_task_work_add(struct io_kiocb *req) * will do the job. */ notify = (req->ctx->flags & IORING_SETUP_SQPOLL) ? TWA_NONE : TWA_SIGNAL; - if (!task_work_add(tsk, &tctx->task_work, notify)) { - wake_up_process(tsk); + if (likely(!task_work_add(tsk, &tctx->task_work, notify))) { + if (notify == TWA_NONE) + wake_up_process(tsk); return; } |