From patchwork Tue Apr 11 14:18:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Aneesh Kumar K.V" X-Patchwork-Id: 13207649 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 A6F11C76196 for ; Tue, 11 Apr 2023 14:19:08 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 4B883280007; Tue, 11 Apr 2023 10:19:08 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 469B1280001; Tue, 11 Apr 2023 10:19:08 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 331A2280007; Tue, 11 Apr 2023 10:19:08 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 2193E280001 for ; Tue, 11 Apr 2023 10:19:08 -0400 (EDT) Received: from smtpin28.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 030E3A0C7D for ; Tue, 11 Apr 2023 14:19:07 +0000 (UTC) X-FDA: 80669317176.28.87672F4 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by imf16.hostedemail.com (Postfix) with ESMTP id 9A005180029 for ; Tue, 11 Apr 2023 14:19:04 +0000 (UTC) Authentication-Results: imf16.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=lEOvq1EF; dmarc=pass (policy=none) header.from=ibm.com; spf=pass (imf16.hostedemail.com: domain of aneesh.kumar@linux.ibm.com designates 148.163.156.1 as permitted sender) smtp.mailfrom=aneesh.kumar@linux.ibm.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1681222744; 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:in-reply-to:references:references:dkim-signature; bh=fNd/P5y+zcBoXSGQADRzWNcE6lwkGr0D6cn4u06vpKI=; b=c7Cp/7vIEaSTL2HapJtLtgTsGpUvlkkiBC/WO+IsAkV684LgnamuV397eJDdwxiQrkhFfT DLVi6uSLNmP0MdV6Rc14NCz6wfG2fAxWvk4TeLD3n2TCLlQlqXiyZ1f+ng+IALAeWQ9zYH SIQ92YVv7N0MufIUAhiN7hdejQjjUpw= ARC-Authentication-Results: i=1; imf16.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=lEOvq1EF; dmarc=pass (policy=none) header.from=ibm.com; spf=pass (imf16.hostedemail.com: domain of aneesh.kumar@linux.ibm.com designates 148.163.156.1 as permitted sender) smtp.mailfrom=aneesh.kumar@linux.ibm.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1681222744; a=rsa-sha256; cv=none; b=b6+Ow4/IiHnAcGdmIMuqQDRxz164gMNnszwQjkDohzyeHL96E5oKc8gs55bu9g8vpzw5NH CiKt0JSnTUmVGT0zD88sFlo+X9wqVHO2VZAEvXSBmNM6mhxP2V1eZZFvqxtwG8CWsaoqZ7 t6i12yo2D9Y9hdmBR2z7WQ3lr26gwNA= Received: from pps.filterd (m0098404.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 33BDxf7V000732; Tue, 11 Apr 2023 14:18:39 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pp1; bh=fNd/P5y+zcBoXSGQADRzWNcE6lwkGr0D6cn4u06vpKI=; b=lEOvq1EFmqAwg6Z9/a/jjXuHdaneqa/7NIT+8/5T0ncu2uMxiuTPfAdsgmeEZbnfeSON O4lm7KZgltUZBL5P1mXwNC5L7qOxEmzDLfd8qxO6VXPN1z02fqvk0DlGqLpoeZ8A3S6/ tckeYGlCWv7twPXET1oNCMKRIA7up1xjtjni4Lzy9wU1EO7lCJS6Bh1FYHXzMZXIWEDd tUY9xmTNtciUU0s9mg1OIuPtg3uKgHWnxS+7S29z+24ItqK8BYr0met+6lpZsv/mAP3F Q/8mdR3ykIgAIMdT0NO6jR5+KhmMvpnNasayiOPwfzEgZUrsLscT0qSV1izai4gDDnml vA== Received: from ppma01dal.us.ibm.com (83.d6.3fa9.ip4.static.sl-reverse.com [169.63.214.131]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3pw8x1rnyb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 11 Apr 2023 14:18:39 +0000 Received: from pps.filterd (ppma01dal.us.ibm.com [127.0.0.1]) by ppma01dal.us.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 33BE4DsW027968; Tue, 11 Apr 2023 14:18:38 GMT Received: from smtprelay06.dal12v.mail.ibm.com ([9.208.130.100]) by ppma01dal.us.ibm.com (PPS) with ESMTPS id 3pu0jj4w8q-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 11 Apr 2023 14:18:38 +0000 Received: from smtpav03.dal12v.mail.ibm.com (smtpav03.dal12v.mail.ibm.com [10.241.53.102]) by smtprelay06.dal12v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 33BEIbHI14811868 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 11 Apr 2023 14:18:37 GMT Received: from smtpav03.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id EEF9358061; Tue, 11 Apr 2023 14:18:36 +0000 (GMT) Received: from smtpav03.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 7865258056; Tue, 11 Apr 2023 14:18:34 +0000 (GMT) Received: from skywalker.ibmuc.com (unknown [9.43.75.136]) by smtpav03.dal12v.mail.ibm.com (Postfix) with ESMTP; Tue, 11 Apr 2023 14:18:34 +0000 (GMT) From: "Aneesh Kumar K.V" To: linux-mm@kvack.org, akpm@linux-foundation.org Cc: "Aneesh Kumar K.V" , Joao Martins , Muchun Song , Dan Williams Subject: [PATCH v2 2/2] m/hugetlb: Rename ARCH_WANT_HUGETLB_PAGE_OPTIMIZE_VMEMMAP Date: Tue, 11 Apr 2023 19:48:18 +0530 Message-Id: <20230411141818.62152-2-aneesh.kumar@linux.ibm.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230411141818.62152-1-aneesh.kumar@linux.ibm.com> References: <20230411141818.62152-1-aneesh.kumar@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: 4T_2o73pdQtBicifXWtRFh_CydT3IgV7 X-Proofpoint-GUID: 4T_2o73pdQtBicifXWtRFh_CydT3IgV7 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-04-11_09,2023-04-11_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 bulkscore=0 adultscore=0 impostorscore=0 phishscore=0 lowpriorityscore=0 spamscore=0 suspectscore=0 malwarescore=0 clxscore=1015 priorityscore=1501 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303200000 definitions=main-2304110131 X-Rspamd-Queue-Id: 9A005180029 X-Rspamd-Server: rspam09 X-Rspam-User: X-Stat-Signature: 3jzfstrpqqf8nobhcpk447zxfwy8bptt X-HE-Tag: 1681222744-991514 X-HE-Meta: U2FsdGVkX1+BE6TawnaH2ie+HlOwxQACF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AfE4B0gNLGgHsV7C6n5Y7uH5g9WocwOa51Fu1GB6a7SyaD/WRwy81dGAbK1Jg0iNmagZ8qIaMbIU0IrTUz479KA90VBt4uIXHaJuaSlGE1mApJY4/KEvZt18p96TvYlr/KjNOmfvwYEAiqCip9lNXoVybkLA1UmI/CREtTvPvIitTPCRt9lud5wbSYGpqJT49EW8I0q/MYNIhV7k0m31rHeLu+g== 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: Now we use ARCH_WANT_HUGETLB_PAGE_OPTIMIZE_VMEMMAP config option to indicate devdax and hugetlb vmemmap optimization support. Hence rename that to a generic ARCH_WANT_OPTIMIZE_VMEMMAP Cc: Joao Martins Cc: Muchun Song Cc: Dan Williams Signed-off-by: Aneesh Kumar K.V Reviewed-by: Muchun Song --- arch/arm64/Kconfig | 2 +- arch/loongarch/Kconfig | 2 +- arch/s390/Kconfig | 2 +- arch/x86/Kconfig | 2 +- fs/Kconfig | 9 +-------- include/linux/mm.h | 2 +- mm/Kconfig | 6 ++++++ 7 files changed, 12 insertions(+), 13 deletions(-) diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index 27b2592698b0..77d9713dcd9c 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -100,9 +100,9 @@ config ARM64 select ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT select ARCH_WANT_FRAME_POINTERS select ARCH_WANT_HUGE_PMD_SHARE if ARM64_4K_PAGES || (ARM64_16K_PAGES && !ARM64_VA_BITS_36) - select ARCH_WANT_HUGETLB_PAGE_OPTIMIZE_VMEMMAP select ARCH_WANT_LD_ORPHAN_WARN select ARCH_WANTS_NO_INSTR + select ARCH_WANT_OPTIMIZE_VMEMMAP select ARCH_WANTS_THP_SWAP if ARM64_4K_PAGES select ARCH_HAS_UBSAN_SANITIZE_ALL select ARM_AMBA diff --git a/arch/loongarch/Kconfig b/arch/loongarch/Kconfig index 9cc8b84f7eb0..9cb00f962de1 100644 --- a/arch/loongarch/Kconfig +++ b/arch/loongarch/Kconfig @@ -53,9 +53,9 @@ config LOONGARCH select ARCH_USE_QUEUED_RWLOCKS select ARCH_USE_QUEUED_SPINLOCKS select ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT - select ARCH_WANT_HUGETLB_PAGE_OPTIMIZE_VMEMMAP select ARCH_WANT_LD_ORPHAN_WARN select ARCH_WANTS_NO_INSTR + select ARCH_WANT_OPTIMIZE_VMEMMAP select BUILDTIME_TABLE_SORT select COMMON_CLK select CPU_PM diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig index 933771b0b07a..df2cd510480a 100644 --- a/arch/s390/Kconfig +++ b/arch/s390/Kconfig @@ -126,7 +126,7 @@ config S390 select ARCH_WANTS_NO_INSTR select ARCH_WANT_DEFAULT_BPF_JIT select ARCH_WANT_IPC_PARSE_VERSION - select ARCH_WANT_HUGETLB_PAGE_OPTIMIZE_VMEMMAP + select ARCH_WANT_OPTIMIZE_VMEMMAP select BUILDTIME_TABLE_SORT select CLONE_BACKWARDS2 select DMA_OPS if PCI diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index a825bf031f49..5269131cc248 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -125,8 +125,8 @@ config X86 select ARCH_WANTS_NO_INSTR select ARCH_WANT_GENERAL_HUGETLB select ARCH_WANT_HUGE_PMD_SHARE - select ARCH_WANT_HUGETLB_PAGE_OPTIMIZE_VMEMMAP if X86_64 select ARCH_WANT_LD_ORPHAN_WARN + select ARCH_WANT_OPTIMIZE_VMEMMAP if X86_64 select ARCH_WANTS_THP_SWAP if X86_64 select ARCH_HAS_PARANOID_L1D_FLUSH select BUILDTIME_TABLE_SORT diff --git a/fs/Kconfig b/fs/Kconfig index e99830c65033..cc07a0cd3172 100644 --- a/fs/Kconfig +++ b/fs/Kconfig @@ -250,16 +250,9 @@ config HUGETLBFS config HUGETLB_PAGE def_bool HUGETLBFS -# -# Select this config option from the architecture Kconfig, if it is preferred -# to enable the feature of HugeTLB Vmemmap Optimization (HVO). -# -config ARCH_WANT_HUGETLB_PAGE_OPTIMIZE_VMEMMAP - bool - config HUGETLB_PAGE_OPTIMIZE_VMEMMAP def_bool HUGETLB_PAGE - depends on ARCH_WANT_HUGETLB_PAGE_OPTIMIZE_VMEMMAP + depends on ARCH_WANT_OPTIMIZE_VMEMMAP depends on SPARSEMEM_VMEMMAP config HUGETLB_PAGE_OPTIMIZE_VMEMMAP_DEFAULT_ON diff --git a/include/linux/mm.h b/include/linux/mm.h index c47f2186d2c2..fb71e21df23d 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -3443,7 +3443,7 @@ void vmemmap_free(unsigned long start, unsigned long end, struct vmem_altmap *altmap); #endif -#ifdef CONFIG_ARCH_WANT_HUGETLB_PAGE_OPTIMIZE_VMEMMA +#ifdef CONFIG_ARCH_WANT_OPTIMIZE_VMEMMAP static inline bool vmemmap_can_optimize(struct vmem_altmap *altmap, struct dev_pagemap *pgmap) { diff --git a/mm/Kconfig b/mm/Kconfig index ff7b209dec05..492919cf62a4 100644 --- a/mm/Kconfig +++ b/mm/Kconfig @@ -460,6 +460,12 @@ config SPARSEMEM_VMEMMAP SPARSEMEM_VMEMMAP uses a virtually mapped memmap to optimise pfn_to_page and page_to_pfn operations. This is the most efficient option when sufficient kernel resources are available. +# +# Select this config option from the architecture Kconfig, if it is preferred +# to enable the feature of HugeTLB/dev_dax vmemmap optimization. +# +config ARCH_WANT_OPTIMIZE_VMEMMAP + bool config HAVE_MEMBLOCK_PHYS_MAP bool