From dfe2d225b86d4215cbd09e863e8de7547f0d4dae Mon Sep 17 00:00:00 2001 From: Patrick Farrell Date: Fri, 7 May 2021 11:37:40 -0400 Subject: [PATCH] LU-13799 clio: Implement real list splice 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 Totals: 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 Signed-off-by: Patrick Farrell Change-Id: Icfd4a3d9dd6f162b011b402a1c88d7dae53eff40 Reviewed-on: https://review.whamcloud.com/39439 Reviewed-by: Wang Shilong Reviewed-by: Bobi Jam Tested-by: jenkins Reviewed-by: Andreas Dilger Tested-by: Maloo --- lustre/obdclass/cl_io.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/lustre/obdclass/cl_io.c b/lustre/obdclass/cl_io.c index a9612e2..d11c5a6 100644 --- a/lustre/obdclass/cl_io.c +++ b/lustre/obdclass/cl_io.c @@ -918,15 +918,24 @@ EXPORT_SYMBOL(cl_page_list_move_head); /** * 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) { +#ifdef USE_LU_REF struct cl_page *page; struct cl_page *tmp; ENTRY; cl_page_list_for_each_safe(page, tmp, list) - cl_page_list_move(head, list, page); + lu_ref_set_at(&page->cp_reference, &page->cp_queue_ref, + "queue", src, dst); +#else + ENTRY; +#endif + dst->pl_nr += src->pl_nr; + src->pl_nr = 0; + list_splice_tail_init(&src->pl_pages, &dst->pl_pages); + EXIT; } EXPORT_SYMBOL(cl_page_list_splice); -- 1.8.3.1