From mboxrd@z Thu Jan 1 00:00:00 1970 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 379FCC6FD1F for ; Tue, 14 Mar 2023 22:36:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230394AbjCNWge (ORCPT ); Tue, 14 Mar 2023 18:36:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57734 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229525AbjCNWgd (ORCPT ); Tue, 14 Mar 2023 18:36:33 -0400 Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DEC6E4D2B1 for ; Tue, 14 Mar 2023 15:36:31 -0700 (PDT) Received: from cwcc.thunk.org (pool-173-48-120-46.bstnma.fios.verizon.net [173.48.120.46]) (authenticated bits=0) (User authenticated as tytso@ATHENA.MIT.EDU) by outgoing.mit.edu (8.14.7/8.12.4) with ESMTP id 32EMaLs3010373 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 14 Mar 2023 18:36:22 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mit.edu; s=outgoing; t=1678833382; bh=rWefUtYyK+Dtv/NQczxgCsKX4ck4TSN33wAHh0awudA=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=UlhT5HDkaXWmvnoiea9rlk2G8QYDvj9uOYtrto0XlnToT9JPIBkErOZeLiRi/PjEv UXoK2UHaTkA8ScjDg4Ls9KF5XDTjoZ/eZaKgHaGLGfCn6JNMsxdgaRpCq+WXx5rbwb mHejKFkAmsi5wyBqudM8yP++7sq+gzMPtQLfdvyxSKNnmAHbCXXaAOFPiG+LbI3QiT zfxPw6S1c57Nl705drY6sJaxW4lwJMgRRl5ZiD1nR9HRi8Fc8G3q1GCSEa6IEvgr0i hOX3X16oLrP/4jtj/Ug/M9IN5FRzRtC4Z3p7PWhHjr4aeTgTv60b20tLDqqSzkYaA7 f/1ZZGqiVjT/w== Received: by cwcc.thunk.org (Postfix, from userid 15806) id 1FA4E15C5830; Tue, 14 Mar 2023 18:36:21 -0400 (EDT) Date: Tue, 14 Mar 2023 18:36:21 -0400 From: "Theodore Ts'o" To: "Matthew Wilcox (Oracle)" Cc: Andreas Dilger , linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: Re: [PATCH 10/31] ext4: Convert ext4_convert_inline_data_to_extent() to use a folio Message-ID: <20230314223621.GY860405@mit.edu> References: <20230126202415.1682629-1-willy@infradead.org> <20230126202415.1682629-11-willy@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230126202415.1682629-11-willy@infradead.org> Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Thu, Jan 26, 2023 at 08:23:54PM +0000, Matthew Wilcox (Oracle) wrote: > Saves a number of calls to compound_head(). Is this left over from an earlier version of this patch series? There are no changes to calls to compound_head() that I can find in this patch. > @@ -565,10 +564,9 @@ static int ext4_convert_inline_data_to_extent(struct address_space *mapping, > > /* We cannot recurse into the filesystem as the transaction is already > * started */ > - flags = memalloc_nofs_save(); > - page = grab_cache_page_write_begin(mapping, 0); > - memalloc_nofs_restore(flags); > - if (!page) { > + folio = __filemap_get_folio(mapping, 0, FGP_WRITEBEGIN | FGP_NOFS, > + mapping_gfp_mask(mapping)); > + if (!folio) { > ret = -ENOMEM; > goto out; > } Is there a reason why to use FGP_NOFS as opposed to using memalloc_nofs_{save,restore}()? I thought using memalloc_nofs_save() is considered the perferred approach by mm-folks. - Ted