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 496BEC369D1 for ; Sun, 27 Apr 2025 11:17:57 +0000 (UTC) Received: from [127.0.0.1] (helo=sfs-ml-4.v29.lw.sourceforge.com) by sfs-ml-4.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1u901E-0001Cn-Gc; Sun, 27 Apr 2025 11:17:56 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-4.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1u901A-0001Cd-HN for linux-f2fs-devel@lists.sourceforge.net; Sun, 27 Apr 2025 11:17:52 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Transfer-Encoding:Content-Type:In-Reply-To: From:References:To:Subject:Cc:MIME-Version:Date:Message-ID:Sender:Reply-To: 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=TsMfZ5WJQgWgrRBKo0cxg3yco/6ptciL1FkLg4BgZLo=; b=dM5DtM5E4vFjan8tSR6R2oFOM9 hz7oVtrylKSdiJGpuAlW2x2y1pdSZu2cIYcvG3Nrwdvm2SffnwMLHFCkqR2YzcFWSzyhj1lubZDeH k/4hEP604NrlH5j+dJ1PccsZhqaamrtMwi09WhRNiJcILR0F38dsGU7b8AsKbZh3otRE=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:References:To: Subject:Cc:MIME-Version:Date:Message-ID:Sender:Reply-To: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=TsMfZ5WJQgWgrRBKo0cxg3yco/6ptciL1FkLg4BgZLo=; b=bqDYm1JXS0PXC327lEYzaQHQqR w0x4bWALARra1BQkPIdyzurn4n4sMTEkTJYn/ZCCClgqEQc32ZsYxQ1OubS6JSA+9TjkqYDl9+9yk 7S9vXklYgW5X1epaCRkqNAU1+GslVIPCmeRpGnt1eLUH7husMHQpfrRV0nYFVNWbFtDo=; Received: from sea.source.kernel.org ([172.234.252.31]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1u900u-000881-TG for linux-f2fs-devel@lists.sourceforge.net; Sun, 27 Apr 2025 11:17:52 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sea.source.kernel.org (Postfix) with ESMTP id 9B219438EE; Sun, 27 Apr 2025 11:17:29 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 325A5C4CEE3; Sun, 27 Apr 2025 11:17:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1745752651; bh=0RdPmJ6S12I8pynby/+EiS+mrp2oNDNGiEOXJi628Fo=; h=Date:Cc:Subject:To:References:From:In-Reply-To:From; b=DNbLWayP4EQZA+0zMEI660XyzEDRzeTQG7INRqpoJlBz2TJFd03t8BIk82jeuIjoT FtPRqGGlxPdzsBH8YD+33oSua35BiSBMY8sySqcChjF8mzb9G7uu47bRXbXTNaxLTB oBcrq4Y56Ek5M/0SGMFDHx7hLFWC1c/WIGCI5WxLeGYlC1bCuJ0A7j90LU1rwSWnsV jvk83j+tA/LEzCzTOOeHf9uBhdvOzUzMG9TbhkXBd8TPv+VU0PhHVCvQ9YtQH3P/KR ZXShofJZSUBL0EiPm3NsblvR0N8q0JrJV7fFvmD8OA0Pg+J2EeDs8rN4NknUCH6Hkm +vl2iTdww35mA== Message-ID: Date: Sun, 27 Apr 2025 19:17:28 +0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird To: "Matthew Wilcox (Oracle)" , Jaegeuk Kim References: <20250331201256.1057782-1-willy@infradead.org> <20250331201256.1057782-20-willy@infradead.org> Content-Language: en-US In-Reply-To: <20250331201256.1057782-20-willy@infradead.org> X-Headers-End: 1u900u-000881-TG Subject: Re: [f2fs-dev] [PATCH 019/153] f2fs: Use a folio in f2fs_ra_meta_pages_cond() 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: , From: Chao Yu via Linux-f2fs-devel Reply-To: Chao Yu Cc: linux-f2fs-devel@lists.sourceforge.net Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net On 4/1/25 04:10, Matthew Wilcox (Oracle) wrote: > Remove a call to find_get_page(). Saves two hidden calls to > compound_head(). Change f2fs_folio_put() to check for IS_ERR_OR_NULL > to handle the case where we got an error pointer back from > filemap_get_folio(). > > Signed-off-by: Matthew Wilcox (Oracle) > --- > fs/f2fs/checkpoint.c | 8 ++++---- > fs/f2fs/f2fs.h | 2 +- > 2 files changed, 5 insertions(+), 5 deletions(-) > > diff --git a/fs/f2fs/checkpoint.c b/fs/f2fs/checkpoint.c > index 1a5fbecd9356..30e68de82f73 100644 > --- a/fs/f2fs/checkpoint.c > +++ b/fs/f2fs/checkpoint.c > @@ -325,16 +325,16 @@ int f2fs_ra_meta_pages(struct f2fs_sb_info *sbi, block_t start, int nrpages, > void f2fs_ra_meta_pages_cond(struct f2fs_sb_info *sbi, pgoff_t index, > unsigned int ra_blocks) > { > - struct page *page; > + struct folio *folio; > bool readahead = false; > > if (ra_blocks == RECOVERY_MIN_RA_BLOCKS) > return; > > - page = find_get_page(META_MAPPING(sbi), index); > - if (!page || !PageUptodate(page)) > + folio = filemap_get_folio(META_MAPPING(sbi), index); > + if (IS_ERR(folio) || !folio_test_uptodate(folio)) > readahead = true; > - f2fs_put_page(page, 0); > + f2fs_folio_put(folio, 0); if (IS_ERR(folio)) folio = NULL; if (!folio || !folio_test_uptodate(folio)) readahead = true; f2fs_folio_put(folio, false); Thanks, > > if (readahead) > f2fs_ra_meta_pages(sbi, index, ra_blocks, META_POR, true); > diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h > index 3d2be01f9363..f05185ed1c75 100644 > --- a/fs/f2fs/f2fs.h > +++ b/fs/f2fs/f2fs.h > @@ -2871,7 +2871,7 @@ static inline struct page *f2fs_pagecache_get_page( > > static inline void f2fs_folio_put(struct folio *folio, bool unlock) > { > - if (!folio) > + if (IS_ERR_OR_NULL(folio)) > return; > > if (unlock) { _______________________________________________ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel