From patchwork Sun Mar 20 13:30:45 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Simmons X-Patchwork-Id: 12786504 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from pdx1-mailman02.dreamhost.com (pdx1-mailman02.dreamhost.com [64.90.62.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id AC9F3C433F5 for ; Sun, 20 Mar 2022 13:32:28 +0000 (UTC) Received: from pdx1-mailman02.dreamhost.com (localhost [IPv6:::1]) by pdx1-mailman02.dreamhost.com (Postfix) with ESMTP id 566D421F9B3; Sun, 20 Mar 2022 06:31:54 -0700 (PDT) Received: from smtp3.ccs.ornl.gov (smtp3.ccs.ornl.gov [160.91.203.39]) by pdx1-mailman02.dreamhost.com (Postfix) with ESMTP id 18AB321E098 for ; Sun, 20 Mar 2022 06:31:18 -0700 (PDT) Received: from star.ccs.ornl.gov (star.ccs.ornl.gov [160.91.202.134]) by smtp3.ccs.ornl.gov (Postfix) with ESMTP id 5CAD7EF6; Sun, 20 Mar 2022 09:31:08 -0400 (EDT) Received: by star.ccs.ornl.gov (Postfix, from userid 2004) id 54D31DD6ED; Sun, 20 Mar 2022 09:31:08 -0400 (EDT) From: James Simmons To: Andreas Dilger , Oleg Drokin , NeilBrown Date: Sun, 20 Mar 2022 09:30:45 -0400 Message-Id: <1647783064-20688-32-git-send-email-jsimmons@infradead.org> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1647783064-20688-1-git-send-email-jsimmons@infradead.org> References: <1647783064-20688-1-git-send-email-jsimmons@infradead.org> Subject: [lustre-devel] [PATCH 31/50] lustre: llite: Remove unnecessary page get/put X-BeenThere: lustre-devel@lists.lustre.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "For discussing Lustre software development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Lustre Development List MIME-Version: 1.0 Errors-To: lustre-devel-bounces@lists.lustre.org Sender: "lustre-devel" From: Patrick Farrell 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 Reviewed-on: https://review.whamcloud.com/44293 Reviewed-by: Andreas Dilger Reviewed-by: Yingjin Qian Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- fs/lustre/obdclass/cl_io.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) 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)