Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp3148591rwb; Mon, 16 Jan 2023 04:29:57 -0800 (PST) X-Google-Smtp-Source: AMrXdXsAb5dUGeH+wtrjU/gWl3lis2gvJVWVqpAzEM8+Kfujc+1oCZr8LgL29ARQB9PE7IWZRcw5 X-Received: by 2002:a17:907:6294:b0:86a:1afa:6dd8 with SMTP id nd20-20020a170907629400b0086a1afa6dd8mr17360653ejc.69.1673872196978; Mon, 16 Jan 2023 04:29:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673872196; cv=none; d=google.com; s=arc-20160816; b=eLlPCRg/tiwuuSquSlIY8CTtDsuFZOkTwayOnMIdv0v99Atrtmd0iKYOoVAQ2u8CKd uL6p48YESBwJPX2cKvSSmeEc5Y89peFcr23kp0nXvekUQqKdpqu/n3ilYuWRvrDReEoK uwmQVvnBKmZ2kLje4e53yLBrD9yUlVZyGk1o8XrEPP3zXuHn4Cvk1hwwgGxrbQuaXiPy d0jgjcGwTK25xXpXXpZz30c2FbpIfbcv6YQzylDkX7wmEw6w3cEdkm6Fx3Di0+qbUoDx urDGlYibcGcK/PpqAWgh9/pbm9tWNDgTO/kwo0Sxu1jJV3x4uYt+EpkgOi0iRscLgY1y UUFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=3yw03o47+b08EFVcD4ME8O+V7rFZEvrdE/PcQSKSu0I=; b=Oi9EuxCWilj9aoskLM86cU9G4GJnAc3tVEopot0cX3tMhl2JTLImLIPEnxvYC5qYjQ W8xnJpqZqC6rNhTcIp00GKHTz5FiWp/29zayYKgDsSrBsJI+nyCAhq5bOOUIizvNSLSO 7McDqzQkhd+/jyoFjNZOoJfktG7Hzn7DyjD0dACi9xO+nLNqAC2nBvDeP21M4X8B6pNc ph1gkAyyszzAyd6FD6UGNJV7Jz4MjOqgGXDgDNSWxvDHZCfAb9ko3jA/D88DeTwasQzV ZX6Bd2qfBRSahaaFpd7Uq3TI50VL9ERwdOTqCZWOkuAtwBPh9YgoCYuAjOLiqJsVKZTR PFjA== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v8-20020a170906b00800b007ade20fc40csi25014927ejy.810.2023.01.16.04.29.44; Mon, 16 Jan 2023 04:29:56 -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; 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; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229695AbjAPLbw (ORCPT + 51 others); Mon, 16 Jan 2023 06:31:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55592 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229583AbjAPLbv (ORCPT ); Mon, 16 Jan 2023 06:31:51 -0500 Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 688DEB76D for ; Mon, 16 Jan 2023 03:31:48 -0800 (PST) Received: from dggpemm500001.china.huawei.com (unknown [172.30.72.57]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4NwV9v6HcQzJqkp; Mon, 16 Jan 2023 19:27:31 +0800 (CST) Received: from [10.174.177.243] (10.174.177.243) by dggpemm500001.china.huawei.com (7.185.36.107) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Mon, 16 Jan 2023 19:31:43 +0800 Message-ID: Date: Mon, 16 Jan 2023 19:31:43 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.5.1 Subject: Re: [PATCH -next 3/7] mm: memory: convert do_cow_fault to use folios Content-Language: en-US To: Matthew Wilcox CC: , , References: <20230112083006.163393-1-wangkefeng.wang@huawei.com> <20230112083006.163393-4-wangkefeng.wang@huawei.com> From: Kefeng Wang In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.174.177.243] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To dggpemm500001.china.huawei.com (7.185.36.107) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS 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 2023/1/13 23:37, Matthew Wilcox wrote: > 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. > For now, as vmf->page and vmf->cow_page used in do_cow_page(), it only supports cow on a page, and after converting, the folio still is 0 order, > 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. > This means that if high(ish)-order folios/multi-order folio on cow, it needs additional jobs and precise page for this pagefault, but for order-0, the converting is right but could break/mislead future logical? not very clear about this part, but let's wait for your patches.