Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp1043083pxf; Thu, 8 Apr 2021 21:07:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxqf490GC6myGpghLnYOI3XkVCmvzfbI+AM40GCZta1a5MCXickjHnY71UxhUADZLxIUE8W X-Received: by 2002:aa7:9aac:0:b029:21a:d3b4:ac with SMTP id x12-20020aa79aac0000b029021ad3b400acmr10566563pfi.12.1617941222325; Thu, 08 Apr 2021 21:07:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617941222; cv=none; d=google.com; s=arc-20160816; b=lZD/bPvTo+940jogNOWnDNfdYPxJArLPctzBCpS+0dTVVwXX/RATGj7ZW/e35Trcom th3PSl2EccDgaLsSiaxN6EX/aUF5hqK7JqOYQHhNThxKis06oNhqnooJT1/UKvH8StOp 3qkNc5nCNjsgv1bDSjcjk5skcNDYo77udtSDR9w3k0OPx7QQ9zYRHnzZQY/l7r98W/pF n2rXlbiXaKMszV4uwGC9yNIbHTx6tfjZPAQ9w9GzVEssQKoFbQHfK8HUfKwE1vPXNY9J 6j8ZsQcDfK4ImbVy5h8wLTKw5tomH3/Nx/1CDM0EmgDc8IoAXjmJP87gbR7RtR34qBH5 +9Lg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=S7R07w3+iKR9Kz8iBev+4cY9N7VRIBOzd0doDm+G1pA=; b=rdOizLz54FzT5Tw7e/HkHM9cJul8/mpHQrrL2bBxADyjW1Gvm0Yw7XYtRvxWm9vXo9 8ZQx+U9iNOdUZUfchXVhnCibB8Y/iFO1/uBPdMnxzpyVmFnZDDKnVwkjkm2qL90O41oF 861K0UofMTejUcE7/kUt1m9p+5u9P/gehA300J8lh6K5uXMb1HdK8EfUAjhJYJimv/Lt 6cQMgS1wLjFhA8Qf1oLjzFv7In6xFYLRkdebHXPbB2ixWljkQfMMWFBbGIRqVud/YoD8 EZSf1XEED0RLBcfLrRkHh8P6rt8xATo8cCTppcxuFwTi3YIX0u3Kl8N4BPqGPMowZPf4 +C3g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p10si1494914plk.248.2021.04.08.21.06.49; Thu, 08 Apr 2021 21:07:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230375AbhDIEEy (ORCPT + 99 others); Fri, 9 Apr 2021 00:04:54 -0400 Received: from foss.arm.com ([217.140.110.172]:40832 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230219AbhDIEEx (ORCPT ); Fri, 9 Apr 2021 00:04:53 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id AC832D6E; Thu, 8 Apr 2021 21:04:39 -0700 (PDT) Received: from [10.163.71.121] (unknown [10.163.71.121]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 22B793F792; Thu, 8 Apr 2021 21:04:37 -0700 (PDT) Subject: Re: [PATCH -next v2 1/2] mm/debug_vm_pgtable: Move {pmd/pud}_huge_tests out of CONFIG_TRANSPARENT_HUGEPAGE To: Shixin Liu , Andrew Morton Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org References: <20210406044900.2178705-1-liushixin2@huawei.com> From: Anshuman Khandual Message-ID: <4f290e6e-0e44-8f9a-52e8-1e113695abbb@arm.com> Date: Fri, 9 Apr 2021 09:35:28 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20210406044900.2178705-1-liushixin2@huawei.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 4/6/21 10:18 AM, Shixin Liu wrote: > v1->v2: > Modified the commit message. Please avoid change log in the commit message, it should be after '---' below the SOB statement. > > The functions {pmd/pud}_set_huge and {pmd/pud}_clear_huge ars not dependent on THP. typo ^^^^^ s/ars/are Also there is a checkpatch.pl warning. WARNING: Possible unwrapped commit description (prefer a maximum 75 chars per line) #10: The functions {pmd/pud}_set_huge and {pmd/pud}_clear_huge ars not dependent on THP. total: 0 errors, 1 warnings, 121 lines checked As I had mentioned in the earlier version, the commit message should be some thing like .. ---- The functions {pmd/pud}_set_huge and {pmd/pud}_clear_huge are not dependent on THP. Hence move {pmd/pud}_huge_tests out of CONFIG_TRANSPARENT_HUGEPAGE. ---- > > Signed-off-by: Shixin Liu > --- > mm/debug_vm_pgtable.c | 91 +++++++++++++++++++------------------------ > 1 file changed, 39 insertions(+), 52 deletions(-) > > diff --git a/mm/debug_vm_pgtable.c b/mm/debug_vm_pgtable.c > index 05efe98a9ac2..d3cf178621d9 100644 > --- a/mm/debug_vm_pgtable.c > +++ b/mm/debug_vm_pgtable.c > @@ -242,29 +242,6 @@ static void __init pmd_leaf_tests(unsigned long pfn, pgprot_t prot) > WARN_ON(!pmd_leaf(pmd)); > } > > -#ifdef CONFIG_HAVE_ARCH_HUGE_VMAP > -static void __init pmd_huge_tests(pmd_t *pmdp, unsigned long pfn, pgprot_t prot) > -{ > - pmd_t pmd; > - > - if (!arch_vmap_pmd_supported(prot)) > - return; > - > - pr_debug("Validating PMD huge\n"); > - /* > - * X86 defined pmd_set_huge() verifies that the given > - * PMD is not a populated non-leaf entry. > - */ > - WRITE_ONCE(*pmdp, __pmd(0)); > - WARN_ON(!pmd_set_huge(pmdp, __pfn_to_phys(pfn), prot)); > - WARN_ON(!pmd_clear_huge(pmdp)); > - pmd = READ_ONCE(*pmdp); > - WARN_ON(!pmd_none(pmd)); > -} > -#else /* CONFIG_HAVE_ARCH_HUGE_VMAP */ > -static void __init pmd_huge_tests(pmd_t *pmdp, unsigned long pfn, pgprot_t prot) { } > -#endif /* CONFIG_HAVE_ARCH_HUGE_VMAP */ > - > static void __init pmd_savedwrite_tests(unsigned long pfn, pgprot_t prot) > { > pmd_t pmd = pfn_pmd(pfn, prot); > @@ -379,30 +356,6 @@ static void __init pud_leaf_tests(unsigned long pfn, pgprot_t prot) > pud = pud_mkhuge(pud); > WARN_ON(!pud_leaf(pud)); > } > - > -#ifdef CONFIG_HAVE_ARCH_HUGE_VMAP > -static void __init pud_huge_tests(pud_t *pudp, unsigned long pfn, pgprot_t prot) > -{ > - pud_t pud; > - > - if (!arch_vmap_pud_supported(prot)) > - return; > - > - pr_debug("Validating PUD huge\n"); > - /* > - * X86 defined pud_set_huge() verifies that the given > - * PUD is not a populated non-leaf entry. > - */ > - WRITE_ONCE(*pudp, __pud(0)); > - WARN_ON(!pud_set_huge(pudp, __pfn_to_phys(pfn), prot)); > - WARN_ON(!pud_clear_huge(pudp)); > - pud = READ_ONCE(*pudp); > - WARN_ON(!pud_none(pud)); > -} > -#else /* !CONFIG_HAVE_ARCH_HUGE_VMAP */ > -static void __init pud_huge_tests(pud_t *pudp, unsigned long pfn, pgprot_t prot) { } > -#endif /* !CONFIG_HAVE_ARCH_HUGE_VMAP */ > - > #else /* !CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD */ > static void __init pud_basic_tests(struct mm_struct *mm, unsigned long pfn, int idx) { } > static void __init pud_advanced_tests(struct mm_struct *mm, > @@ -412,9 +365,6 @@ static void __init pud_advanced_tests(struct mm_struct *mm, > { > } > static void __init pud_leaf_tests(unsigned long pfn, pgprot_t prot) { } > -static void __init pud_huge_tests(pud_t *pudp, unsigned long pfn, pgprot_t prot) > -{ > -} > #endif /* CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD */ > #else /* !CONFIG_TRANSPARENT_HUGEPAGE */ > static void __init pmd_basic_tests(unsigned long pfn, int idx) { } > @@ -433,14 +383,51 @@ static void __init pud_advanced_tests(struct mm_struct *mm, > } > static void __init pmd_leaf_tests(unsigned long pfn, pgprot_t prot) { } > static void __init pud_leaf_tests(unsigned long pfn, pgprot_t prot) { } > +static void __init pmd_savedwrite_tests(unsigned long pfn, pgprot_t prot) { } > +#endif /* CONFIG_TRANSPARENT_HUGEPAGE */ > + > +#ifdef CONFIG_HAVE_ARCH_HUGE_VMAP > static void __init pmd_huge_tests(pmd_t *pmdp, unsigned long pfn, pgprot_t prot) > { > + pmd_t pmd; > + > + if (!arch_vmap_pmd_supported(prot)) > + return; > + > + pr_debug("Validating PMD huge\n"); > + /* > + * X86 defined pmd_set_huge() verifies that the given > + * PMD is not a populated non-leaf entry. > + */ > + WRITE_ONCE(*pmdp, __pmd(0)); > + WARN_ON(!pmd_set_huge(pmdp, __pfn_to_phys(pfn), prot)); > + WARN_ON(!pmd_clear_huge(pmdp)); > + pmd = READ_ONCE(*pmdp); > + WARN_ON(!pmd_none(pmd)); > } > + > static void __init pud_huge_tests(pud_t *pudp, unsigned long pfn, pgprot_t prot) > { > + pud_t pud; > + > + if (!arch_vmap_pud_supported(prot)) > + return; > + > + pr_debug("Validating PUD huge\n"); > + /* > + * X86 defined pud_set_huge() verifies that the given > + * PUD is not a populated non-leaf entry. > + */ > + WRITE_ONCE(*pudp, __pud(0)); > + WARN_ON(!pud_set_huge(pudp, __pfn_to_phys(pfn), prot)); > + WARN_ON(!pud_clear_huge(pudp)); > + pud = READ_ONCE(*pudp); > + WARN_ON(!pud_none(pud)); > } > -static void __init pmd_savedwrite_tests(unsigned long pfn, pgprot_t prot) { } > -#endif /* CONFIG_TRANSPARENT_HUGEPAGE */ > +#else /* !CONFIG_HAVE_ARCH_HUGE_VMAP */ > +static void __init pmd_huge_tests(pmd_t *pmdp, unsigned long pfn, pgprot_t prot) { } > +static void __init pud_huge_tests(pud_t *pudp, unsigned long pfn, pgprot_t prot) { } > +#endif /* CONFIG_HAVE_ARCH_HUGE_VMAP */ > > static void __init p4d_basic_tests(unsigned long pfn, pgprot_t prot) > { > With changes to the commit message as suggested earlier. Reviewed-by: Anshuman Khandual