Thread (31 messages) 31 messages, 3 authors, 2021-09-30

Re: [PATCH v2 04/24] io_uring: use slist for completion batching

From: Jens Axboe <axboe@kernel.dk>
Date: 2021-09-28 15:32:20

On 9/28/21 3:41 AM, Pavel Begunkov wrote:
On 9/26/21 7:57 AM, Hao Xu wrote:
quoted
在 2021/9/25 上午4:59, Pavel Begunkov 写道:
quoted
Currently we collect requests for completion batching in an array.
Replace them with a singly linked list. It's as fast as arrays but
doesn't take some much space in ctx, and will be used in future patches.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
---
  fs/io_uring.c | 52 +++++++++++++++++++++++++--------------------------
  1 file changed, 25 insertions(+), 27 deletions(-)
diff --git a/fs/io_uring.c b/fs/io_uring.c
index 9c14e9e722ba..9a76c4f84311 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -322,8 +322,8 @@ struct io_submit_state {
      /*
       * Batch completion logic
       */
-    struct io_kiocb        *compl_reqs[IO_COMPL_BATCH];
-    unsigned int        compl_nr;
+    struct io_wq_work_list    compl_reqs;
Will it be better to rename struct io_wq_work_list to something more
generic, io_wq_work_list is a bit confused, we are now using this
type of linked list (stack as well) for various aim, not just to link
iowq works.
Was thinking about it, e.g. io_slist, but had been already late --
lots of conflicts and a good chance to add a couple of extra bugs
on rebase. I think we can do it afterward (if ever considering
it troubles backporting)
Agree with both of you - it should be renamed, but at the same time it's
also really annoying with trivial conflicts for eg stable patches due to
random renaming. I was bit by this again just recently, function rename
in that case.

So let's keep the name for now, and once we have some quiet time, we
can get that done.

-- 
Jens Axboe
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help