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 X-Spam-Level: X-Spam-Status: No, score=-13.9 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,NICE_REPLY_A, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 28B03C433E2 for ; Fri, 4 Sep 2020 04:10:01 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id DD50A206CA for ; Fri, 4 Sep 2020 04:10:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DD50A206CA Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 8885A6B0037; Fri, 4 Sep 2020 00:10:00 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 838296B005C; Fri, 4 Sep 2020 00:10:00 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 74E236B005D; Fri, 4 Sep 2020 00:10:00 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0148.hostedemail.com [216.40.44.148]) by kanga.kvack.org (Postfix) with ESMTP id 5F1D06B0037 for ; Fri, 4 Sep 2020 00:10:00 -0400 (EDT) Received: from smtpin10.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 1A2712484 for ; Fri, 4 Sep 2020 04:10:00 +0000 (UTC) X-FDA: 77224050960.10.bee93_4707ee9270af Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin10.hostedemail.com (Postfix) with ESMTP id D886A16A0DE for ; Fri, 4 Sep 2020 04:09:59 +0000 (UTC) X-HE-Tag: bee93_4707ee9270af X-Filterd-Recvd-Size: 3599 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by imf04.hostedemail.com (Postfix) with ESMTP for ; Fri, 4 Sep 2020 04:09:59 +0000 (UTC) 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 B7066101E; Thu, 3 Sep 2020 21:09:58 -0700 (PDT) Received: from [10.163.70.23] (unknown [10.163.70.23]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id D26E53F71F; Thu, 3 Sep 2020 21:09:56 -0700 (PDT) Subject: Re: [PATCH v4 05/13] mm/debug_vm_pgtable/savedwrite: Enable savedwrite test with CONFIG_NUMA_BALANCING To: "Aneesh Kumar K.V" , linux-mm@kvack.org, akpm@linux-foundation.org Cc: mpe@ellerman.id.au, linuxppc-dev@lists.ozlabs.org References: <20200902114222.181353-1-aneesh.kumar@linux.ibm.com> <20200902114222.181353-6-aneesh.kumar@linux.ibm.com> From: Anshuman Khandual Message-ID: Date: Fri, 4 Sep 2020 09:39:24 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20200902114222.181353-6-aneesh.kumar@linux.ibm.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: D886A16A0DE X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam01 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On 09/02/2020 05:12 PM, Aneesh Kumar K.V wrote: > Saved write support was added to track the write bit of a pte after > marking the pte protnone. This was done so that AUTONUMA can convert > a write pte to protnone and still track the old write bit. When converting > it back we set the pte write bit correctly thereby avoiding a write fault > again. Hence enable the test only when CONFIG_NUMA_BALANCING is enabled and > use protnone protflags. > > Signed-off-by: Aneesh Kumar K.V > --- > mm/debug_vm_pgtable.c | 11 +++++++++-- > 1 file changed, 9 insertions(+), 2 deletions(-) > > diff --git a/mm/debug_vm_pgtable.c b/mm/debug_vm_pgtable.c > index 4c73e63b4ceb..8704901f6bd8 100644 > --- a/mm/debug_vm_pgtable.c > +++ b/mm/debug_vm_pgtable.c > @@ -119,10 +119,14 @@ static void __init pte_savedwrite_tests(unsigned long pfn, pgprot_t prot) > { > pte_t pte = pfn_pte(pfn, prot); > > + if (!IS_ENABLED(CONFIG_NUMA_BALANCING)) > + return; > + > pr_debug("Validating PTE saved write\n"); > WARN_ON(!pte_savedwrite(pte_mk_savedwrite(pte_clear_savedwrite(pte)))); > WARN_ON(pte_savedwrite(pte_clear_savedwrite(pte_mk_savedwrite(pte)))); > } > + > #ifdef CONFIG_TRANSPARENT_HUGEPAGE > static void __init pmd_basic_tests(unsigned long pfn, pgprot_t prot) > { > @@ -234,6 +238,9 @@ static void __init pmd_savedwrite_tests(unsigned long pfn, pgprot_t prot) > { > pmd_t pmd = pfn_pmd(pfn, prot); > > + if (!IS_ENABLED(CONFIG_NUMA_BALANCING)) > + return; > + > pr_debug("Validating PMD saved write\n"); > WARN_ON(!pmd_savedwrite(pmd_mk_savedwrite(pmd_clear_savedwrite(pmd)))); > WARN_ON(pmd_savedwrite(pmd_clear_savedwrite(pmd_mk_savedwrite(pmd)))); > @@ -1019,8 +1026,8 @@ static int __init debug_vm_pgtable(void) > pmd_huge_tests(pmdp, pmd_aligned, prot); > pud_huge_tests(pudp, pud_aligned, prot); > > - pte_savedwrite_tests(pte_aligned, prot); > - pmd_savedwrite_tests(pmd_aligned, prot); > + pte_savedwrite_tests(pte_aligned, protnone); > + pmd_savedwrite_tests(pmd_aligned, protnone); > > pte_unmap_unlock(ptep, ptl); > > No more checkpatch.pl warnings. Reviewed-by: Anshuman Khandual