From patchwork Thu Mar 2 11:48:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anshuman Khandual X-Patchwork-Id: 13157163 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id E98F2C678D4 for ; Thu, 2 Mar 2023 11:49:00 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 801876B0071; Thu, 2 Mar 2023 06:49:00 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 78AF66B0073; Thu, 2 Mar 2023 06:49:00 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 62B056B0074; Thu, 2 Mar 2023 06:49:00 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 50AE96B0071 for ; Thu, 2 Mar 2023 06:49:00 -0500 (EST) Received: from smtpin28.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 18A491609C1 for ; Thu, 2 Mar 2023 11:49:00 +0000 (UTC) X-FDA: 80523786840.28.A161F2C Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by imf30.hostedemail.com (Postfix) with ESMTP id 8B32D8000D for ; Thu, 2 Mar 2023 11:48:57 +0000 (UTC) Authentication-Results: imf30.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=arm.com; spf=pass (imf30.hostedemail.com: domain of anshuman.khandual@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=anshuman.khandual@arm.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1677757737; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:references; bh=c7mzOY3mMVPzSIyrOKgLa3tOsXt32PdzPhh9wBP+ixk=; b=f2M6K351WcK9ubF6RbbQN5XZqAcmt19W+ggecmJKQOwS+5xK1K8hJ01zGesKOXp+Wz9RAi 7RDx0MdM6NploekwICX9+k0o26r6REN8KuGpozUnlxD6a0AnPYeu1c5Xo85LekCUNnDpSM A2DUlG13cHRgvq1F1vfJOIoYq8jNbfo= ARC-Authentication-Results: i=1; imf30.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=arm.com; spf=pass (imf30.hostedemail.com: domain of anshuman.khandual@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=anshuman.khandual@arm.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1677757737; a=rsa-sha256; cv=none; b=Fg/rj0JUpMOGHCjFBvcnYaIRmoOfY3ZhYNZnFWJXBRjURDrHw/Xf9NSlpcCwxDy3UQYgrb bAcKqRMQEVNILftqgeiKGrbmjpheUNVpwVwjIsLtky7qHdMhXhNOmDQq17w9zH21zKE2/7 9cWqvi8gE+8ZSJEeD6eSBdJkzwh7ZS8= 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 A93BC1FB; Thu, 2 Mar 2023 03:49:39 -0800 (PST) Received: from a077893.arm.com (unknown [10.163.85.162]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 277B23F587; Thu, 2 Mar 2023 03:48:52 -0800 (PST) From: Anshuman Khandual To: linux-mm@kvack.org Cc: david@redhat.com, mike.kravetz@oracle.com, Anshuman Khandual , Jonathan Corbet , Andrew Morton , "Mike Rapoport (IBM)" , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Christophe Leroy Subject: [PATCH V2] mm/debug_vm_pgtable: Replace pte_mkhuge() with arch_make_huge_pte() Date: Thu, 2 Mar 2023 17:18:45 +0530 Message-Id: <20230302114845.421674-1-anshuman.khandual@arm.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 8B32D8000D X-Stat-Signature: 1ntdgtmqbdwnwfdupx9uwdkpy599nate X-HE-Tag: 1677757737-207951 X-HE-Meta: U2FsdGVkX1+FwgosaVeKqV+Oj4r+J0fThicPkLBWhqrTijN062mMtbnCELU6hKYjfNRQ2S3LY+KSEK+JVn8oK2AZG16LxBKCirgHFjkjhTPleL5kDsri2wzxbfsXX66ZaJ4ka3rO8Bwmr+aMOsIbQEGWaUSTWSuHxT5WAJNUbV6Wzte1sIOFGhCuKCDpfQ/TdFC/BlKvJwmRCo3Wq7xGFd08kbOm05jkIsu5ckIQZ8RACjSkLffXwz98nkeNa0eJgPMMIFqqkFHG0VL5X7q3GPMw9Ql2J+3nNHgtVNFV8MHX2Vt934ITZixF9Zp84Niz37WDyBORDt4/03tNdqqhlXbqs8rdF899HHwgcdTv6IXxUjl4IYbZze5IrNejSvq4xyZb0fTlMXZoWSKyCGlOglkl6f0EFbK9qyXwNhhzW420qH4RTGPSmvOpqCOaLTEZ9BTvHzvK8caQY6Ys6zc9WqiFM3Oapd8Zu4EM4y8ByGXA66Vr1Vy6kmkpni5A/iZs2LDPw9iGVIIlPU67prQCAsQG02a0+Ihf39SKeD3coN90UEdpggIcyeL79PcEmGoFjbO2r9GnXjr/28Sc3A4tr+3zP84v3zxopOz9Sqjzih5/+/bad8q90Uq5BV7o1Y0BR+qjEhTuedkmJOFcwXS+otk2o3u3yTYaCin4tN8uzrh9C8bauBq0Fa9DAe2RbrnjUicT5Dbgcg3qbqHi7KjGQ7/rWCecWAxNp/CVlBOE/rtKLQ169JWg+c7Es74wf2F40SBxwXqoXm+brKsSS8T1GSWn2WSfIjrQwMeZPuTlIttSR/JfCpDq3HaFFUgSg2antPj21a5Ml1+IPf8F5wrZGHiHfJBMt2lzSwfCeTMvCkTkxR0oprGfBSCFJqxouckjgu5GmLxxrnVjKpNBpNlB/vLnXqBDB6E1Ajzy2nT/nmBpGn1ACIZiHqw0TITQf/ijfiFvLD7C+HyAwsLv4CL 7C9G+Eeu jnNUCusySingO2bqzMnVJhdEYuYZ5jOGaYrLJxxUrzaDGJfwGq2okuptZK7pVmJPUctM4IvCf6u4HFOYgppZNahG8ZdsXlcq79pdQ1ASd0QPxxCxd2lm+xe4XLAHCBgITPSp+GlqkACVZH8mbcKTnGpkAIbsT4Q2YjLAygVGF1+wVIyfKy5LDY8LLCoJ35OYER3Z2Nsu8jcVKk2MEp1lAwjbKPyy9pK9degKJM0pGqORXIvGlhBA+EWs6NtAkVU6MHU35Z+LtoRfbK+Io8BG+J087iRV0ow1UXb25zrpDWn1ccYyAPRu+ifq835WOyjdTUGLomTw2Gra15TaDq/7bvLfdbEqvmuJ3tDGCiPi76j9il9t6Jgc8TtHxRGEcSoWY+J2LgM23bhrhvTva2jQGszW76iNgZPzoIMy4sSDcWnsJyQbyC31DuzQXK0p69S6DkNvxvPpGn290elMFwGgE90yZfvjaM/WJrAl0f4xpPgSDeAf9Yv3VA0MxjxwjzXJPETTyiSMbKu5vU8U= 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: Since the following commit arch_make_huge_pte() should be used directly in generic memory subsystem as a platform provided page table helper, instead of pte_mkhuge(). Change hugetlb_basic_tests() to call arch_make_huge_pte() directly, and update its relevant documentation entry as required. 'commit 16785bd77431 ("mm: merge pte_mkhuge() call into arch_make_huge_pte()")' Cc: Jonathan Corbet Cc: Andrew Morton Cc: "Mike Rapoport (IBM)" Cc: linux-doc@vger.kernel.org Cc: linux-kernel@vger.kernel.org Cc: linux-mm@kvack.org Reported-by: Christophe Leroy Link: https://lore.kernel.org/all/1ea45095-0926-a56a-a273-816709e9075e@csgroup.eu/ Signed-off-by: Anshuman Khandual --- This applies on latest mainline. Changes in V2: - Send PMD_SHIFT and VM_ACCESS_FLAGS as arguments for arch_make_huge_pte() Changes in V1: https://lore.kernel.org/all/20230302031833.360679-1-anshuman.khandual@arm.com/ Documentation/mm/arch_pgtable_helpers.rst | 2 +- mm/debug_vm_pgtable.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Documentation/mm/arch_pgtable_helpers.rst b/Documentation/mm/arch_pgtable_helpers.rst index 30d9a09f01f4..af3891f895b0 100644 --- a/Documentation/mm/arch_pgtable_helpers.rst +++ b/Documentation/mm/arch_pgtable_helpers.rst @@ -214,7 +214,7 @@ HugeTLB Page Table Helpers +---------------------------+--------------------------------------------------+ | pte_huge | Tests a HugeTLB | +---------------------------+--------------------------------------------------+ -| pte_mkhuge | Creates a HugeTLB | +| arch_make_huge_pte | Creates a HugeTLB | +---------------------------+--------------------------------------------------+ | huge_pte_dirty | Tests a dirty HugeTLB | +---------------------------+--------------------------------------------------+ diff --git a/mm/debug_vm_pgtable.c b/mm/debug_vm_pgtable.c index af59cc7bd307..7887cc2b75bf 100644 --- a/mm/debug_vm_pgtable.c +++ b/mm/debug_vm_pgtable.c @@ -934,7 +934,7 @@ static void __init hugetlb_basic_tests(struct pgtable_debug_args *args) #ifdef CONFIG_ARCH_WANT_GENERAL_HUGETLB pte = pfn_pte(args->fixed_pmd_pfn, args->page_prot); - WARN_ON(!pte_huge(pte_mkhuge(pte))); + WARN_ON(!pte_huge(arch_make_huge_pte(pte, PMD_SHIFT, VM_ACCESS_FLAGS))); #endif /* CONFIG_ARCH_WANT_GENERAL_HUGETLB */ } #else /* !CONFIG_HUGETLB_PAGE */