public inbox for [email protected]
 help / color / mirror / Atom feed
* [PATCH for-5.10] io_uring: remove req cancel in ->flush()
@ 2020-10-19 15:45 Pavel Begunkov
  2020-10-19 20:08 ` Jens Axboe
  2020-10-22  6:42 ` Xiaoguang Wang
  0 siblings, 2 replies; 9+ messages in thread
From: Pavel Begunkov @ 2020-10-19 15:45 UTC (permalink / raw)
  To: Jens Axboe, io-uring

Every close(io_uring) causes cancellation of all inflight requests
carrying ->files. That's not nice but was neccessary up until recently.
Now task->files removal is handled in the core code, so that part of
flush can be removed.

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

diff --git a/fs/io_uring.c b/fs/io_uring.c
index 95d2bb7069c6..6536e24eb44e 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -8748,16 +8748,12 @@ void __io_uring_task_cancel(void)
 
 static int io_uring_flush(struct file *file, void *data)
 {
-	struct io_ring_ctx *ctx = file->private_data;
+	bool exiting = !data;
 
-	/*
-	 * If the task is going away, cancel work it may have pending
-	 */
 	if (fatal_signal_pending(current) || (current->flags & PF_EXITING))
-		data = NULL;
+		exiting = true;
 
-	io_uring_cancel_task_requests(ctx, data);
-	io_uring_attempt_task_drop(file, !data);
+	io_uring_attempt_task_drop(file, exiting);
 	return 0;
 }
 
-- 
2.24.0


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

end of thread, other threads:[~2020-10-23  3:34 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-10-19 15:45 [PATCH for-5.10] io_uring: remove req cancel in ->flush() Pavel Begunkov
2020-10-19 20:08 ` Jens Axboe
2020-10-19 23:40   ` Pavel Begunkov
2020-10-20 14:09     ` Jens Axboe
2020-10-20 16:29       ` Pavel Begunkov
2020-10-20 16:59         ` Jens Axboe
2020-10-22  6:42 ` Xiaoguang Wang
2020-10-22 11:44   ` Pavel Begunkov
2020-10-23  3:33     ` Xiaoguang Wang

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