Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp8024428rwb; Tue, 6 Dec 2022 13:00:10 -0800 (PST) X-Google-Smtp-Source: AA0mqf5GrVP+63Wix4nKsNueAYEBA4Z4NiFr6mxjnUwL32TZIQPv//J82IHBAYpMtxe/jWyAkKsj X-Received: by 2002:a17:906:15ca:b0:7a5:7c1c:cc5c with SMTP id l10-20020a17090615ca00b007a57c1ccc5cmr74016868ejd.644.1670360410397; Tue, 06 Dec 2022 13:00:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670360410; cv=none; d=google.com; s=arc-20160816; b=SHPPsmjiv74dHE6uD2w/u71sjrsN+htXeGUEbox9KnFrNwd4ItMj4KEkI0U1VKljvx BP9IrTOcyaXwZxDO7w09Lf8sLH/jP0h52uUW8PuPrNPfegwX8kMP7Kv/1R4T36aefKyt 20vyDXYTXBnIli1PbQQ7Lkajy3YXsZskS5I/JYG/2c5l9Ni9K23P067Z2yyS3s/Ziw8p kDiypvtuzi2V8xtAhZ4cx6CUO4avhf2Ai6/MoqCtOOYqcgHa1/xDo3KU3VN7tCw1j2Xa CR7i37mdb3dCltU8eIsT2p0KCvsBSNFNqjsXW0r2KLqzJHsTr0REQmYoWeONOrUC0SHa 6Crw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=fCWSY7cJhC6SCsB3eS/lFIy0C//ufeGGLBNh5MPIYFM=; b=S8uZ+AmtMKlKWCzhKrZgvMabrhNSHk2zfQ1fDL6eWnY57LBdCw0GbpvHA8f1ub4VQC 7N/pDIRTp6pY1tcqtDewg3nG0UOzK53WFBNGZ2F5CybCdgMC6MT0BYJwxPOtX8QoEL+V DwbL+qCA8NJ2ikPAJm6bTncVbr1OCeHQs6+yK9EbLgyFZFbeZ/DNA//TmD8kWrghYWcQ EQp0OI4C5WlxSD9V9gHptLqy9719aseGZuA4oItw1svSlgyGG04mS405X/ofKNtLCl/r MU9dxfvYq0UGnwLWPXP8uEh/2YRZEUZCu95F5nqsrIu6S7SyPYzrvQjrN11KR6dntPQn ubTQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=XwL9Wmse; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t11-20020a056402524b00b0045d3e06e4d5si3341467edd.389.2022.12.06.12.59.45; Tue, 06 Dec 2022 13:00:10 -0800 (PST) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=XwL9Wmse; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229514AbiLFUxn (ORCPT + 99 others); Tue, 6 Dec 2022 15:53:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44608 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229637AbiLFUxm (ORCPT ); Tue, 6 Dec 2022 15:53:42 -0500 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 665712AC47; Tue, 6 Dec 2022 12:53:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=fCWSY7cJhC6SCsB3eS/lFIy0C//ufeGGLBNh5MPIYFM=; b=XwL9WmsevY1I4e+gKktbMIjyPZ 7YR84ru8ttEvCxmMOObqRIzHYEebEI2uAbr1/v2x99Q+EqRSvtK7uPJ8gXa/2lhfAvsZZE5DqXeFN eGU0a8U8jQ8vZtwQiI3cmQatmYx9pjDu2HrZgw1hGOtrm/kQVW0VL3I2gYMLRTl9sbjRdRtY+vAwW pixTnKryWDAJnUtGnw/bErL/18wljmeI4qBUQvjDkAuQYlEQpIsr5pwiBrrhGsKxz8PQ2lMCYifwL rjbSBuVtzxI50nVC5RHStvS7qVU0M0JSKpdGOC+6K2ONKh32AiLueU9F1lwvd4YUZ0Cyqyqlv68ev zEa3BS9A==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1p2ewj-004oCG-4Y; Tue, 06 Dec 2022 20:53:45 +0000 Date: Tue, 6 Dec 2022 20:53:45 +0000 From: Matthew Wilcox To: "Vishal Moola (Oracle)" Cc: linux-mm@kvack.org, tytso@mit.edu, linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org, akpm@linux-foundation.org Subject: Re: [PATCH mm-unstable] ext4: Convert mext_page_double_lock() to mext_folio_double_lock() Message-ID: References: <20221206204115.35258-1-vishal.moola@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Tue, Dec 06, 2022 at 08:50:02PM +0000, Matthew Wilcox wrote: > > flags = memalloc_nofs_save(); > > - page[0] = grab_cache_page_write_begin(mapping[0], index1); > > - if (!page[0]) { > > + folio[0] = __filemap_get_folio(mapping[0], index1, fgp_flags, > > + mapping_gfp_mask(mapping[0])); > > one > > > + if (!folio[0]) { > > memalloc_nofs_restore(flags); > > return -ENOMEM; > > } > > > > - page[1] = grab_cache_page_write_begin(mapping[1], index2); > > + folio[1] = __filemap_get_folio(mapping[1], index2, fgp_flags, > > + mapping_gfp_mask(mapping[1])); > > two *facepalm*. Those don't contain calls to compound_head(), they contain calls to folio_file_page(), which is still a moderately-expensive unnecessary conversion, but a conversion in the other direction.