From 45cb47726602a40949b38f957ffadcc80c1d306c Mon Sep 17 00:00:00 2001 From: Patrick Farrell Date: Wed, 19 Jan 2022 10:49:36 -0500 Subject: [PATCH] LU-13799 llite: Remove unnecessary page get/put Part of the aio cleanup code has the slightly strange behavior of doing get on every page before calling page cleanup, then doing a put after. This was required because we call cl_page_list_del before calling cl_page_delete, and cl_page_list_del was holding the last reference on the page struct. If we reverse the order, then we don't need the extra get/put to keep the pages live. This should save significant CPU time in the ptlrpcd threads when finishing i/o, since this removes a get/put on every page. Lustre-change: https://review.whamcloud.com/44293 Lustre-commit: c2e94f08cf3ff000b350faf61b6d25ebbad7970e Signed-off-by: Patrick Farrell Change-Id: Ia9e7bf4a331a5220bfb1eab43493ac5fda59c611 Reviewed-on: https://review.whamcloud.com/44688 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger --- lustre/obdclass/cl_io.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lustre/obdclass/cl_io.c b/lustre/obdclass/cl_io.c index 40d3251..8f6bdf3 100644 --- a/lustre/obdclass/cl_io.c +++ b/lustre/obdclass/cl_io.c @@ -1213,10 +1213,8 @@ static void cl_aio_end(const struct lu_env *env, struct cl_sync_io *anchor) while (aio->cda_pages.pl_nr > 0) { struct cl_page *page = cl_page_list_first(&aio->cda_pages); - cl_page_get(page); - cl_page_list_del(env, &aio->cda_pages, page); cl_page_delete(env, page); - cl_page_put(env, page); + cl_page_list_del(env, &aio->cda_pages, page); } if (!aio->cda_no_aio_complete) -- 1.8.3.1