diff options
| author | Jens Axboe <axboe@kernel.dk> | 2023-03-06 13:15:06 -0700 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-03-11 16:40:00 +0100 |
| commit | 3f32f8492e10ec740552c051a1b0a331490f356b (patch) | |
| tree | 8aa39b79c073574034ed3622342afb4e1946d293 /io_uring | |
| parent | 306c8b49b5666856dfe74d032e2dc5ac17d3784e (diff) | |
| download | linux-3f32f8492e10ec740552c051a1b0a331490f356b.tar.gz linux-3f32f8492e10ec740552c051a1b0a331490f356b.tar.bz2 linux-3f32f8492e10ec740552c051a1b0a331490f356b.zip | |
io_uring: handle TIF_NOTIFY_RESUME when checking for task_work
commit b5d3ae202fbfe055aa2a8ae8524531ee1dcab717 upstream.
If TIF_NOTIFY_RESUME is set, then we need to call resume_user_mode_work()
for PF_IO_WORKER threads. They never return to usermode, hence never get
a chance to process any items that are marked by this flag. Most notably
this includes the final put of files, but also any throttling markers set
by block cgroups.
Cc: stable@vger.kernel.org # 5.10+
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/io_uring.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c index cf6f8aeb450d..67e820798d25 100644 --- a/io_uring/io_uring.c +++ b/io_uring/io_uring.c @@ -2460,6 +2460,13 @@ static inline unsigned int io_put_rw_kbuf(struct io_kiocb *req) static inline bool io_run_task_work(void) { + /* + * PF_IO_WORKER never returns to userspace, so check here if we have + * notify work that needs processing. + */ + if (current->flags & PF_IO_WORKER && + test_thread_flag(TIF_NOTIFY_RESUME)) + tracehook_notify_resume(NULL); if (test_thread_flag(TIF_NOTIFY_SIGNAL) || current->task_works) { __set_current_state(TASK_RUNNING); tracehook_notify_signal(); |
