diff mbox series

[31/50] lustre: llite: Remove unnecessary page get/put

Message ID 1647783064-20688-32-git-send-email-jsimmons@infradead.org (mailing list archive)
State New, archived
Headers show
Series lustre: update to OpenSFS tree as of March 20, 2022 | expand

Commit Message

James Simmons March 20, 2022, 1:30 p.m. UTC
From: Patrick Farrell <pfarrell@whamcloud.com>

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.

WC-bug-id: https://jira.whamcloud.com/browse/LU-13799
Lustre-commit: c2e94f08cf3ff000b ("LU-13799 llite: Remove unnecessary page get/put")
Signed-off-by: Patrick Farrell <pfarrell@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/44293
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Yingjin Qian <qian@ddn.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
---
 fs/lustre/obdclass/cl_io.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/fs/lustre/obdclass/cl_io.c b/fs/lustre/obdclass/cl_io.c
index e4fc795..6dd029a 100644
--- a/fs/lustre/obdclass/cl_io.c
+++ b/fs/lustre/obdclass/cl_io.c
@@ -1129,10 +1129,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)