From patchwork Tue Feb 18 05:51:59 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 13979089 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 lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (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 8E10DC3DA4A for ; Tue, 18 Feb 2025 05:52:18 +0000 (UTC) Received: from [127.0.0.1] (helo=sfs-ml-2.v29.lw.sourceforge.com) by sfs-ml-2.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1tkGWn-0000J4-Dr; Tue, 18 Feb 2025 05:52:18 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-2.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1tkGWl-0000IQ-4X for linux-f2fs-devel@lists.sourceforge.net; Tue, 18 Feb 2025 05:52:15 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Transfer-Encoding:MIME-Version:References: In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=7OWCqEQSuyW3YDJH4zlFbHrnNTVKwf50bge0kn69gbA=; b=C4Bvqp5jK6LttUVd4XAzubPjre 7cWiZg7ez+vFZWXzVWh3r/R9K3fQnuf3g5gAzUz78dy2NCPN6v6sYtXgq9I+rynEiUU/pyBUz3NH6 9SLWWe25nifyw/An6q3Sy+zpKpWBmNHwR6LYecFU0J2K8Kv+lzyPEGsAjNOJoCg+rj+0=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID: Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=7OWCqEQSuyW3YDJH4zlFbHrnNTVKwf50bge0kn69gbA=; b=WYKvvyHsB/IAUxgPpCavTRxqvu /WkTugUPVUTLF5xLsrnKJ/l0acZqWJcd6W3YLXZQvZNBMwryU6TY1WZsq0KRUo4Kvy6BYqMiu0gr1 DSrwmo0Oa1pznYGG4h6XGc3UyCylBXBgj6lAZDO4qwu7o/BsKEwfFBUatGT4foeg1Wqk=; Received: from casper.infradead.org ([90.155.50.34]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1tkGWl-0007bn-AV for linux-f2fs-devel@lists.sourceforge.net; Tue, 18 Feb 2025 05:52:15 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=7OWCqEQSuyW3YDJH4zlFbHrnNTVKwf50bge0kn69gbA=; b=UE29ImrUER/K1iaAUcim3GyRZV RHPVNjrcNdCWjod5wi/ZCG5TvP5uNBu6cXISITlHBRO2HAy9Da3T2tpWKPEGbJIP4lMlUtYg5HSlp e3N6ZIs3PDDup+Myl7DOHjSxRcbpbAfrauMmMHo32Vn7uqqm4gn3qUCVxJzGE5WuI/qe1B6c1zojg AFvuhzGa0xsdXPeO0lSYok0MmCVoW7ydYc9kdRddzeEfEURIgvEcCXSaHSBoNzvB1KuFGAxmp4VeY czD9LgTZxlqaF/pcgfigcdukF2o5fUjCCz7Ld2VTWceXhi2Eh9PZdYG72WM+ZKqkPRH4i8sh7jZn0 3vHNh99Q==; Received: from willy by casper.infradead.org with local (Exim 4.98 #2 (Red Hat Linux)) id 1tkGWf-00000002Ttl-08jb; Tue, 18 Feb 2025 05:52:09 +0000 From: "Matthew Wilcox (Oracle)" To: Jaegeuk Kim , Chao Yu Date: Tue, 18 Feb 2025 05:51:59 +0000 Message-ID: <20250218055203.591403-26-willy@infradead.org> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250218055203.591403-1-willy@infradead.org> References: <20250218055203.591403-1-willy@infradead.org> MIME-Version: 1.0 X-Headers-End: 1tkGWl-0007bn-AV Subject: [f2fs-dev] [PATCH 25/27] f2fs: Convert gc_data_segment() to use a folio X-BeenThere: linux-f2fs-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-fsdevel@vger.kernel.org, "Matthew Wilcox \(Oracle\)" , linux-f2fs-devel@lists.sourceforge.net Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net Use f2fs_get_read_data_folio() instead of f2fs_get_read_data_page(). Saves a hidden call to compound_head() in f2fs_put_page(). Signed-off-by: Matthew Wilcox (Oracle) --- fs/f2fs/gc.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c index d0fffa2bd9f0..2b8f9239bede 100644 --- a/fs/f2fs/gc.c +++ b/fs/f2fs/gc.c @@ -1542,7 +1542,6 @@ static int gc_data_segment(struct f2fs_sb_info *sbi, struct f2fs_summary *sum, entry = sum; for (off = 0; off < usable_blks_in_seg; off++, entry++) { - struct page *data_page; struct inode *inode; struct node_info dni; /* dnode info for the data */ unsigned int ofs_in_node, nofs; @@ -1585,6 +1584,7 @@ static int gc_data_segment(struct f2fs_sb_info *sbi, struct f2fs_summary *sum, ofs_in_node = le16_to_cpu(entry->ofs_in_node); if (phase == 3) { + struct folio *data_folio; int err; inode = f2fs_iget(sb, dni.ino); @@ -1635,15 +1635,15 @@ static int gc_data_segment(struct f2fs_sb_info *sbi, struct f2fs_summary *sum, continue; } - data_page = f2fs_get_read_data_page(inode, start_bidx, + data_folio = f2fs_get_read_data_folio(inode, start_bidx, REQ_RAHEAD, true, NULL); f2fs_up_write(&F2FS_I(inode)->i_gc_rwsem[WRITE]); - if (IS_ERR(data_page)) { + if (IS_ERR(data_folio)) { iput(inode); continue; } - f2fs_put_page(data_page, 0); + f2fs_folio_put(data_folio, false); add_gc_inode(gc_list, inode); continue; }