public inbox for [email protected]
 help / color / mirror / Atom feed
* [PATCH] io_uring: drop mm/files between task_work_submit
@ 2021-02-04 19:22 Pavel Begunkov
  2021-02-04 19:43 ` Jens Axboe
  0 siblings, 1 reply; 2+ messages in thread
From: Pavel Begunkov @ 2021-02-04 19:22 UTC (permalink / raw)
  To: Jens Axboe, io-uring; +Cc: stable

Since SQPOLL task can be shared and so task_work entries can be a mix of
them, we need to drop mm and files before trying to issue next request.

Cc: [email protected] # 5.10+
Signed-off-by: Pavel Begunkov <[email protected]>
---
 fs/io_uring.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/fs/io_uring.c b/fs/io_uring.c
index 5d3348d66f06..1f68105a41ed 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -2205,6 +2205,9 @@ static void __io_req_task_submit(struct io_kiocb *req)
 	else
 		__io_req_task_cancel(req, -EFAULT);
 	mutex_unlock(&ctx->uring_lock);
+
+	if (ctx->flags & IORING_SETUP_SQPOLL)
+		io_sq_thread_drop_mm_files();
 }
 
 static void io_req_task_submit(struct callback_head *cb)
-- 
2.24.0


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

* Re: [PATCH] io_uring: drop mm/files between task_work_submit
  2021-02-04 19:22 [PATCH] io_uring: drop mm/files between task_work_submit Pavel Begunkov
@ 2021-02-04 19:43 ` Jens Axboe
  0 siblings, 0 replies; 2+ messages in thread
From: Jens Axboe @ 2021-02-04 19:43 UTC (permalink / raw)
  To: Pavel Begunkov, io-uring; +Cc: stable

On 2/4/21 12:22 PM, Pavel Begunkov wrote:
> Since SQPOLL task can be shared and so task_work entries can be a mix of
> them, we need to drop mm and files before trying to issue next request.

Thanks, applied.

-- 
Jens Axboe


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

end of thread, other threads:[~2021-02-04 19:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-02-04 19:22 [PATCH] io_uring: drop mm/files between task_work_submit Pavel Begunkov
2021-02-04 19:43 ` Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox