[PATCH 10/14] io_uring: don't block resource recycle by oveflows

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



We don't want resource recycling (e.g. pre-registered files fput) to be
delayed by overflowed requests. Drop fixed_file_refs before putting into
overflow lists.

Signed-off-by: Pavel Begunkov <asml.silence@xxxxxxxxx>
---
 fs/io_uring.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/fs/io_uring.c b/fs/io_uring.c
index c895e42201c8..9720e38b5b97 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -1851,6 +1851,13 @@ static void __io_cqring_fill_event(struct io_kiocb *req, long res, long cflags)
 		io_clean_op(req);
 		req->result = res;
 		req->compl.cflags = cflags;
+
+		/* Don't block resource recycling by overflowed requests */
+		if (req->fixed_file_refs) {
+			percpu_ref_put(req->fixed_file_refs);
+			req->fixed_file_refs = NULL;
+		}
+
 		refcount_inc(&req->refs);
 		list_add_tail(&req->compl.list, &ctx->cq_overflow_list);
 	}
-- 
2.24.0




[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux