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 1F09AC7619A for ; Sat, 8 Apr 2023 04:43:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229741AbjDHEmi (ORCPT ); Sat, 8 Apr 2023 00:42:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42850 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229523AbjDHEme (ORCPT ); Sat, 8 Apr 2023 00:42:34 -0400 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7F44CBB8E for ; Fri, 7 Apr 2023 21:42:32 -0700 (PDT) Received: from kwepemm600020.china.huawei.com (unknown [172.30.72.54]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4PtjHB4F8FzrZ6v; Sat, 8 Apr 2023 12:41:10 +0800 (CST) Received: from [10.174.179.160] (10.174.179.160) by kwepemm600020.china.huawei.com (7.193.23.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Sat, 8 Apr 2023 12:42:28 +0800 Message-ID: <7a127da3-9a53-962c-1096-562a03e39864@huawei.com> Date: Sat, 8 Apr 2023 12:42:11 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.9.0 Subject: Re: [PATCH v5 1/6] userfaultfd: convert mfill_atomic_pte_copy() to use a folio Content-Language: en-US To: Mike Kravetz CC: , , , , , , , , References: <20230331093937.945725-1-zhangpeng362@huawei.com> <20230331093937.945725-2-zhangpeng362@huawei.com> <20230406213127.GB14244@monkey> From: "zhangpeng (AS)" In-Reply-To: <20230406213127.GB14244@monkey> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.174.179.160] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To kwepemm600020.china.huawei.com (7.193.23.147) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2023/4/7 5:31, Mike Kravetz wrote: > On 03/31/23 17:39, Peng Zhang wrote: >> From: ZhangPeng >> >> Call vma_alloc_folio() directly instead of alloc_page_vma() and convert >> page_kaddr to kaddr in mfill_atomic_pte_copy(). Removes several calls to >> compound_head(). >> >> Signed-off-by: ZhangPeng >> Reviewed-by: Sidhartha Kumar >> --- >> mm/userfaultfd.c | 33 +++++++++++++++++---------------- >> 1 file changed, 17 insertions(+), 16 deletions(-) > Looks good, > > Reviewed-by: Mike Kravetz > >> } else { >> - page = *pagep; >> + folio = page_folio(*pagep); >> + VM_BUG_ON_FOLIO(folio_test_large(folio), folio); >> *pagep = NULL; >> } > However, I am still unsure about the reason for adding the VM_BUG_ON_FOLIO > here. VM_BUG_ON_FOLIO was added to ensure that folio is a single-page folio. However, the folio corresponding to the foliop is always a single-page folio. We just don't need this check. I'll drop VM_BUG_ON_FOLIO. Thanks for your review. Best Regards, Peng