From d31647c017a390c9553a38d82c02fe7001a33a05 Mon Sep 17 00:00:00 2001 From: Patrick Farrell Date: Fri, 7 May 2021 15:42:20 -0400 Subject: [PATCH] LU-13799 lov: Improve DIO submit Skip some unnecessary looping in page submission for the DIO case. This gives about a 2% improvement for AIO/DIO page submission. This patch reduces i/o time in ms/GiB by: Write: 2 ms/GiB Read: 2 ms/GiB Totals: Write: 172 ms/GiB Read: 165 ms/GiB mpirun -np 1 $IOR -w -r -t 64M -b 64G -o ./iorfile --posix.odirect With previous patches in series: write 7726 MiB/s read 5899 MiB/s Plus this patch: write 5954 MiB/s read 6217 MiB/s Signed-off-by: Patrick Farrell Change-Id: Iedad978438ee3f1f3290d990311532626cba9e2d Reviewed-on: https://review.whamcloud.com/39446 Reviewed-by: Wang Shilong Reviewed-by: Andreas Dilger Tested-by: jenkins Tested-by: Maloo Reviewed-by: Oleg Drokin --- lustre/lov/lov_io.c | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/lustre/lov/lov_io.c b/lustre/lov/lov_io.c index 9ffd102..ae0964b 100644 --- a/lustre/lov/lov_io.c +++ b/lustre/lov/lov_io.c @@ -1284,12 +1284,16 @@ static int lov_io_submit(const struct lu_env *env, struct lov_io *lio = cl2lov_io(env, ios); struct lov_io_sub *sub; struct cl_page_list *plist = &lov_env_info(env)->lti_plist; - struct cl_page *page; + struct cl_page *page = cl_page_list_first(qin); struct cl_page *tmp; + bool dio = false; int index; int rc = 0; ENTRY; + if (page->cp_type == CPT_TRANSIENT) + dio = true; + cl_page_list_init(plist); while (qin->pl_nr > 0) { struct cl_2queue *cl2q = &lov_env_info(env)->lti_cl2q; @@ -1312,12 +1316,17 @@ static int lov_io_submit(const struct lu_env *env, cl_page_list_move(&cl2q->c2_qin, qin, page); index = page->cp_lov_index; - cl_page_list_for_each_safe(page, tmp, qin) { - /* this page is not on this stripe */ - if (index != page->cp_lov_index) - continue; - - cl_page_list_move(&cl2q->c2_qin, qin, page); + /* DIO is already split by stripe */ + if (!dio) { + cl_page_list_for_each_safe(page, tmp, qin) { + /* this page is not on this stripe */ + if (index != page->cp_lov_index) + continue; + + cl_page_list_move(&cl2q->c2_qin, qin, page); + } + } else { + cl_page_list_splice(qin, &cl2q->c2_qin); } sub = lov_sub_get(env, lio, index); -- 1.8.3.1