Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp2224331pxb; Sun, 18 Apr 2021 23:47:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJypGNnB8fDrGRTS6IjgZH3z8PcWMBTpJ0AthHidzNjn5OAP3ntdglwD+WwPMzj0JYDRyJCs X-Received: by 2002:a05:6402:6cf:: with SMTP id n15mr15905514edy.51.1618814870502; Sun, 18 Apr 2021 23:47:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618814870; cv=none; d=google.com; s=arc-20160816; b=bLjmqLGool2s3yL09bDXk7MEZvVxyzEbifQWi5xPZDSN/rXRq0XIBO7m9udt5ZfZmR vNb/R/Y1gtp7JyJpYzteByoJXvvZP9LfjyzS/QWRrLJzZ9mPOTJSttSoxHJX8KqculCV Zex1HmyqgNB4OowT7nalbx/cW+WQh4Uf7JTCRyL2BvtU105X5NlVZmHNTcRYHiMhtCwK CwRwRQLbTFyFGf6bgdYH00iczw8M4Wb6k3BoXMwJnogwg63BwWI2KG9hQKUg9/Jlt90P fXVdpgqdq5kVSFIA6pla2t5xFLLBMURCIK9D/VqH9YoxmxDYIugSHvxzwz1b9wZIMRCJ 8i1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=2D8zMybsltlC5HMpd4EE2U9bmoqg/vCFYRc5aMhb65A=; b=kAaCGtj1bJPlrL8iDBYwEB57BMtGUnAl3zCZEca7uDPG57VoEcpIQDQuVAKMxYsG+E TKym2IvpRgKzSZn3bXy3ulxZ2QD1NMBEMuMiesn3j00j/SaTFaML8AG8GySD+B+v8FHf gquwH7MiSKyKBiicl6v4/33+iADHaMWqmAbyRWAug0jmu3bBPDzNczo5e7mzgtkBa1C1 N2j9PeNtkEOMZt7CHWr2fN2pLwib6mDZUZRkIMJRLgxYhLSP4p164b5nSmRs5tvA0sb+ fEALy5oOOpwwrld98cWijOo670aO7xCvuYi5cEU2AUslH9AumHmexr/mtwl1ttGuZAT1 eRZQ== 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=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u13si11318607ejt.333.2021.04.18.23.47.27; Sun, 18 Apr 2021 23:47:50 -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=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233920AbhDSGqE (ORCPT + 99 others); Mon, 19 Apr 2021 02:46:04 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:16477 "EHLO szxga05-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231942AbhDSGqC (ORCPT ); Mon, 19 Apr 2021 02:46:02 -0400 Received: from DGGEMS404-HUB.china.huawei.com (unknown [172.30.72.60]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4FNy1p4hRqzqTq5; Mon, 19 Apr 2021 14:43:10 +0800 (CST) Received: from huawei.com (10.175.113.32) by DGGEMS404-HUB.china.huawei.com (10.3.19.204) with Microsoft SMTP Server id 14.3.498.0; Mon, 19 Apr 2021 14:45:22 +0800 From: Liu Shixin To: Andrew Morton , Anshuman Khandual CC: , , Shixin Liu Subject: [PATCH -next v3 2/2] mm/debug_vm_pgtable: Remove redundant pfn_{pmd/pte}() and fix one comment mistake Date: Mon, 19 Apr 2021 15:18:20 +0800 Message-ID: <20210419071820.750217-2-liushixin2@huawei.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210419071820.750217-1-liushixin2@huawei.com> References: <20210419071820.750217-1-liushixin2@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.113.32] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Shixin Liu Remove redundant pfn_{pmd/pte}() in {pmd/pte}_advanced_tests() and adjust pfn_pud() in pud_advanced_tests() to make it similar with other two functions. In addition, the branch condition should be CONFIG_TRANSPARENT_HUGEPAGE instead of CONFIG_ARCH_HAS_PTE_DEVMAP. Signed-off-by: Shixin Liu Reviewed-by: Anshuman Khandual --- v2->v3: Modified the commit message. v1->v2: Remove redundant pfn_pte() and fold two patch to one. mm/debug_vm_pgtable.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/mm/debug_vm_pgtable.c b/mm/debug_vm_pgtable.c index d3cf178621d9..e2f35db8ba69 100644 --- a/mm/debug_vm_pgtable.c +++ b/mm/debug_vm_pgtable.c @@ -91,7 +91,7 @@ static void __init pte_advanced_tests(struct mm_struct *mm, unsigned long pfn, unsigned long vaddr, pgprot_t prot) { - pte_t pte = pfn_pte(pfn, prot); + pte_t pte; /* * Architectures optimize set_pte_at by avoiding TLB flush. @@ -185,7 +185,7 @@ static void __init pmd_advanced_tests(struct mm_struct *mm, unsigned long pfn, unsigned long vaddr, pgprot_t prot, pgtable_t pgtable) { - pmd_t pmd = pfn_pmd(pfn, prot); + pmd_t pmd; if (!has_transparent_hugepage()) return; @@ -300,7 +300,7 @@ static void __init pud_advanced_tests(struct mm_struct *mm, unsigned long pfn, unsigned long vaddr, pgprot_t prot) { - pud_t pud = pfn_pud(pfn, prot); + pud_t pud; if (!has_transparent_hugepage()) return; @@ -309,6 +309,7 @@ static void __init pud_advanced_tests(struct mm_struct *mm, /* Align the address wrt HPAGE_PUD_SIZE */ vaddr = (vaddr & HPAGE_PUD_MASK) + HPAGE_PUD_SIZE; + pud = pfn_pud(pfn, prot); set_pud_at(mm, vaddr, pudp, pud); pudp_set_wrprotect(mm, vaddr, pudp); pud = READ_ONCE(*pudp); @@ -742,12 +743,12 @@ static void __init pmd_swap_soft_dirty_tests(unsigned long pfn, pgprot_t prot) WARN_ON(!pmd_swp_soft_dirty(pmd_swp_mksoft_dirty(pmd))); WARN_ON(pmd_swp_soft_dirty(pmd_swp_clear_soft_dirty(pmd))); } -#else /* !CONFIG_ARCH_HAS_PTE_DEVMAP */ +#else /* !CONFIG_TRANSPARENT_HUGEPAGE */ static void __init pmd_soft_dirty_tests(unsigned long pfn, pgprot_t prot) { } static void __init pmd_swap_soft_dirty_tests(unsigned long pfn, pgprot_t prot) { } -#endif /* CONFIG_ARCH_HAS_PTE_DEVMAP */ +#endif /* CONFIG_TRANSPARENT_HUGEPAGE */ static void __init pte_swap_tests(unsigned long pfn, pgprot_t prot) { -- 2.25.1