Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp29553545rwd; Wed, 5 Jul 2023 13:43:14 -0700 (PDT) X-Google-Smtp-Source: APBJJlGNOvpU8Eh6aFJpWGCFJ9Y6WNSClt9BNiGOTydwOcuz7OCgNQ9YReIamVIe57yFu83LhX28 X-Received: by 2002:a17:902:ecc2:b0:1b6:6e3a:77fb with SMTP id a2-20020a170902ecc200b001b66e3a77fbmr164410plh.2.1688589794482; Wed, 05 Jul 2023 13:43:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688589794; cv=none; d=google.com; s=arc-20160816; b=Hgr0Pu6Crk7U7RFlLmneyp364J2oLp9cCYNfmoQN0YnpQDDZ0YX/l70FX53eCCh2Vv kRk/fNT6XOnRDTQNwH6FAOdZYQXhe1hsDudzRD59Zoqp4ToY3FzaE5VQX8dwUCMWmUGk NcT3Q358UpITzjXuOl6h/YwK0XgdSjKbLfoJdM5RgePC9cHUhywGPeyAao3DjSJvN7zV hGPx3ly8GrvhfRrWbfLJU6FzQoUuW4lrF44EI3Ydx9uL65qcgTxo1M2GMsRALMG8IAnX dSS48+pYjVbsygH6M6momHERq52GwYSj8SSYKNRp67YuVLfXBkwtcJ/QCPUkxTmFEFSu 6EBQ== 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=hYu/o3mpdq+vSG0rEUxmM7nw3556mrzLaeAJu/zu1Qs=; fh=XLJLg8WXdhwGrMSzs3MfkZczrcBsqkmvHzzfT+Z54/s=; b=hnt5DYxVID5kVNkPKrfP+SdRm/xQ8pctKkvAFfm1xqw4hwt8sDwrjM8gGgdHZkKIrs 84T6e1Y+mMzEpTNlndXNWmaQR4UlRDtA3gmedZQgBY4h+ofzsIoBrmvsNWLHJiPrynzc eV0aR7LJ4t2pt8oK9EEcJkmnbWhxVbXkNFT6pwUUPrtyxvTD4hjx/HTABAGybJEOXEOW DClBN0IjNbnxShNyqcl0867Ek1lrBfdbnLHgtsxhg603Z4qqiJuq19mGsaf/HUrCDcBz 48OLmmzr4WR7IdkgXGMRx5ySu+xCZs6oq/dHXzkcnRrve5dPUB0c24jw6aTk25z+rU/i FntQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=aZl41unk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-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 c15-20020a170903234f00b001b7fdf423f3si9963444plh.566.2023.07.05.13.43.02; Wed, 05 Jul 2023 13:43:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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=aZl41unk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233373AbjGEUD6 (ORCPT + 99 others); Wed, 5 Jul 2023 16:03:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34752 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232546AbjGEUD5 (ORCPT ); Wed, 5 Jul 2023 16:03:57 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3FBE118B for ; Wed, 5 Jul 2023 13:03:56 -0700 (PDT) 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=hYu/o3mpdq+vSG0rEUxmM7nw3556mrzLaeAJu/zu1Qs=; b=aZl41unkOjryNr+eFfIF42oXWU jOwgmOQmLrp6G7WW9S63RIPCZ2hiLgPxisQ+80/X9THBVSTXUg6p3ugVFumbTcjrgLUXGO1qq4uuR GGHASJA2Pp3fiwDakd2kGZT3YRPO/CQqGckFoQ6sE0M2+VkXWuOpGXP+LARV7YiBoNH6ItUfaiP6U TyJIgjPjUOzOHh3EXs5jaIeXA9djKcxKEXxKSn8omhSaqDC+hkvHK/nhifwj7LAdeRZ/VY+TmgXwo Gzo6eMbeC1cUm495Sl6RTbztKcONMs1iLnV2jC4eMUtn+wLfmAEuPthCLDaXoDJenTQR3F5qOOp5a KiZkA3kg==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1qH8jA-00ANt8-05; Wed, 05 Jul 2023 20:03:52 +0000 Date: Wed, 5 Jul 2023 21:03:51 +0100 From: Matthew Wilcox To: Sidhartha Kumar Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, akpm@linux-foundation.org Subject: Re: [PATCH v2 2/4] mm/memory: convert wp_page_shared() to use folios Message-ID: References: <20230705194335.273790-1-sidhartha.kumar@oracle.com> <20230705194335.273790-2-sidhartha.kumar@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230705194335.273790-2-sidhartha.kumar@oracle.com> 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,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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-kernel@vger.kernel.org On Wed, Jul 05, 2023 at 12:43:33PM -0700, Sidhartha Kumar wrote: > @@ -3375,7 +3375,7 @@ static vm_fault_t do_wp_page(struct vm_fault *vmf) > */ > if (!vmf->page) > return wp_pfn_shared(vmf); > - return wp_page_shared(vmf); > + return wp_page_shared(vmf, page_folio(vmf->page)); > } > > if (vmf->page) I was actually hoping you'd move: if (vmf->page) folio = page_folio(vmf->page); up to immediately after the call to vm_normal_page(), and avoid even this call to page_folio().