[lustre-devel] [PATCH 13/15] lustre: clio: Implement real list splice

James Simmons jsimmons at infradead.org
Wed Jul 7 12:11:14 PDT 2021

From: Patrick Farrell <farr0186 at gmail.com>

Lustre's list_splice is actually just a slightly
depressing list_for_each; let's use a real list_splice.

This saves significant time in AIO/DIO page submission,
getting a several % performance boost.

This patch reduces i/o time in ms/GiB by:
Write: 16 ms/GiB
Read: 14 ms/GiB

Write: 220 ms/GiB
Read: 209 ms/GiB

mpirun -np 1  $IOR -w -r -t 64M -b 64G -o ./iorfile --posix.odirect

With previous patches in series:
write     4326 MiB/s
read      4587 MiB/s

With this patch:
write     4647 MiB/s
read      4888 MiB/s

WC-bug-id: https://jira.whamcloud.com/browse/LU-13799
Lustre-commit: dfe2d225b86d4215 ("LU-13799 clio: Implement real list splice")
Signed-off-by: Patrick Farrell <farr0186 at gmail.com>
Reviewed-on: https://review.whamcloud.com/39439
Reviewed-by: Wang Shilong <wshilong at whamcloud.com>
Reviewed-by: Bobi Jam <bobijam at hotmail.com>
Reviewed-by: Andreas Dilger <adilger at whamcloud.com>
Signed-off-by: James Simmons <jsimmons at infradead.org>
 fs/lustre/obdclass/cl_io.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/fs/lustre/obdclass/cl_io.c b/fs/lustre/obdclass/cl_io.c
index beda7fc..63ce39c 100644
--- a/fs/lustre/obdclass/cl_io.c
+++ b/fs/lustre/obdclass/cl_io.c
@@ -891,13 +891,11 @@ void cl_page_list_move_head(struct cl_page_list *dst, struct cl_page_list *src,
  * splice the cl_page_list, just as list head does
-void cl_page_list_splice(struct cl_page_list *list, struct cl_page_list *head)
+void cl_page_list_splice(struct cl_page_list *src, struct cl_page_list *dst)
-	struct cl_page *page;
-	struct cl_page *tmp;
-	cl_page_list_for_each_safe(page, tmp, list)
-		cl_page_list_move(head, list, page);
+	dst->pl_nr += src->pl_nr;
+	src->pl_nr = 0;
+	list_splice_tail_init(&src->pl_pages, &dst->pl_pages);

More information about the lustre-devel mailing list