Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp1146206rwb; Fri, 13 Jan 2023 08:27:34 -0800 (PST) X-Google-Smtp-Source: AMrXdXuS/dbcxHcudPaUIKzt1YSDnX59AcqErpnYAqWWkG+p6ISABiZEambVXJqvyi4ZM717Rbef X-Received: by 2002:a05:6a20:2ca:b0:b6:4ca8:eb7d with SMTP id 10-20020a056a2002ca00b000b64ca8eb7dmr9950571pzb.50.1673627253935; Fri, 13 Jan 2023 08:27:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673627253; cv=none; d=google.com; s=arc-20160816; b=cBrth+Ap0E0aF7QEkUodyCY3F/d6PLN66im+egRtGR/CJewg38T3aYDWioXvZu+oHV YMwnRX/RTInGuINJB4CwxTEwqon36TUEVdbnHbRmuFI7cSUUpGb+6OuAnx2kHzd9clwp R3x54iwfIXnQNVhj1xYIqH/fBvGWeCXMfhGCEMwHGxvrwv/1q/VSyl0SwzYsiVYEPxGk ELPgQlm7wqI7jH/SskwN+1zUUc4AjSC69aIF/ex2aBOKgKUHsynYP4eckMjzCRaLDwUr wS2an4szHeZ5pyfBjGcu4I2oXWsHFVwa2kBMQaNcKL4aHHvDlDg+ib/Xpfsx6opnQ1qr sJNA== 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=ggOkbzb2S7+qH5Fcr8YUMXOVLwxMkbp5ZnrWSch+hlc=; b=SURCtNSNWkaO7jV5YChYw+biEycK/eJVZMS9bXl9N4xPUJiRoiZaD1QiSCwz5qofhr z+m/w8ALlD2u9HpcRCJcwuu9JQObry1zkRYSCkXWr86YLsjCICFjGXvzCv2R7jadyGgO lU58fvtiDpgAVdoKpdT7THtj3aKypw9oOFQuL7YboxTnKHqhsOboQrLEXnFHi1v/wHCd 2Uhv+Giwt6biXyat9fzzfpJ2rIOQX/jFHZhDXDqiYdK3DBzZ5eVlaowb6JAvz02+7gxw ze8zE+k+bSEd/fzmk6VeibOaNAZwwDjK7DPXjQxeIjpMkU0FxWHf8zPnEr0qQhUpOrjK WUTA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=ePzihjjY; 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 p123-20020a634281000000b004a0dd5c1e54si21357335pga.108.2023.01.13.08.27.27; Fri, 13 Jan 2023 08:27:33 -0800 (PST) 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=ePzihjjY; 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 S229509AbjAMPrI (ORCPT + 51 others); Fri, 13 Jan 2023 10:47:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34780 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229765AbjAMPpx (ORCPT ); Fri, 13 Jan 2023 10:45:53 -0500 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1726991511 for ; Fri, 13 Jan 2023 07:37:00 -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=ggOkbzb2S7+qH5Fcr8YUMXOVLwxMkbp5ZnrWSch+hlc=; b=ePzihjjYQFkujbVarL4raFGxs2 2UFLjM04Ah+XzR8ZuLRPlWN2Fs4IjxXJJ0yW2Zq0dwQ+kPF+wZU9x0oRYYpJ38TesS81D4VTimdwf CyqMwNHs+NI4SpnV53MQ9WOTwa8NHYCGaucO51bmvIFDNVE+XDP5ykWsRD1e+Izkpr/sIeGGwmP/5 edSt4V7qEkn6kRGljjV8yFI4xxuROSQqqznydbnbISO7Mw+XgovQZkPgcAwH9g42vWrdzIezH9Cl8 6hfi+E/NGo9na1oftamdOjHL0OJPc5EoxYEkO4AXvT+2PVPJfcl12m7AsCgSISAhNYv/rKfHNcFOP 5FSBS9yg==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1pGM79-006D9n-IQ; Fri, 13 Jan 2023 15:37:07 +0000 Date: Fri, 13 Jan 2023 15:37:07 +0000 From: Matthew Wilcox To: Kefeng Wang Cc: akpm@linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH -next 3/7] mm: memory: convert do_cow_fault to use folios Message-ID: References: <20230112083006.163393-1-wangkefeng.wang@huawei.com> <20230112083006.163393-4-wangkefeng.wang@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230112083006.163393-4-wangkefeng.wang@huawei.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 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 Thu, Jan 12, 2023 at 04:30:02PM +0800, Kefeng Wang wrote: > - vmf->cow_page = alloc_page_vma(GFP_HIGHUSER_MOVABLE, vma, vmf->address); > - if (!vmf->cow_page) > + cow_folio = vma_alloc_folio(GFP_HIGHUSER_MOVABLE, 0, vma, vmf->address, > + false); > + if (!cow_folio) I have a patch I've been sitting on that converts vmf->cow_page to be a folio. I think this series is well and truly wrecked at this point, so let me go back and dig it out; see if it still makes sense. I'm a bit unsure about it because maybe we want to allocate high(ish)-order folios on COW fault, and if we do, then maybe we want to align them in some way with the virtual addresses, or the other folios in the VMA. And then we might want to indicate the precise page for this page fault rather than have this page fault be the start of a multi-order folio.