From patchwork Tue Aug 1 04:41:10 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: 13335761 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 B1AADC0015E for ; Tue, 1 Aug 2023 04:41:49 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 165762800DC; Tue, 1 Aug 2023 00:41:49 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1157C2800C8; Tue, 1 Aug 2023 00:41:49 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id F1FED2800DC; Tue, 1 Aug 2023 00:41:48 -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 E047D2800C8 for ; Tue, 1 Aug 2023 00:41:48 -0400 (EDT) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id BD6FDB2183 for ; Tue, 1 Aug 2023 04:41:48 +0000 (UTC) X-FDA: 81074287896.01.656E7B5 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by imf04.hostedemail.com (Postfix) with ESMTP id 7087940004 for ; Tue, 1 Aug 2023 04:41:46 +0000 (UTC) Authentication-Results: imf04.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=Zq0BPTP8; spf=pass (imf04.hostedemail.com: domain of aneesh.kumar@linux.ibm.com designates 148.163.156.1 as permitted sender) smtp.mailfrom=aneesh.kumar@linux.ibm.com; dmarc=pass (policy=none) header.from=ibm.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1690864906; 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=aKFNefd2TBLZ6cEsX29AYF2dHHKvLqjSwjs//gL5bUw=; b=uwhpCmGWg35AuX6tX6KAhH+BLLhSYUaMW24Mnu/aoTjDpwxwnhDH/Lms7wfxdl1jCxTqPj eNlm2SivJjh+NRLb25a9wbZZGvkPihKeV41WkOJitW1owRvLh/fTu6rOXhmkp5cMNFuwCD lvtlqrgiXmLBfeeikaKwYMSinlgFcE4= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1690864906; a=rsa-sha256; cv=none; b=HSfglAJ3GpSt1AXNjK/0gQxIuXtp2TNwEFQn2yz6mbXk4nP4Y7WxvGUDCfN0XkITYXoQm3 FBf8IUh4mTwafYoOQ58iirUMaPra280EViVN7Boy2PU4XpSiC78P/UU0f7BBF77SDrBVIY XkQfavay5PBU7A+OemwfxAiohePcmA8= ARC-Authentication-Results: i=1; imf04.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=Zq0BPTP8; spf=pass (imf04.hostedemail.com: domain of aneesh.kumar@linux.ibm.com designates 148.163.156.1 as permitted sender) smtp.mailfrom=aneesh.kumar@linux.ibm.com; dmarc=pass (policy=none) header.from=ibm.com Received: from pps.filterd (m0356517.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3714cM3d025278; Tue, 1 Aug 2023 04:41:38 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=aKFNefd2TBLZ6cEsX29AYF2dHHKvLqjSwjs//gL5bUw=; b=Zq0BPTP8QEsGqgEclFKE5xudSl8CU5lNgWaen+NS5lBzWA9U7yG7uB3vQrCXOSWkBMwY OXFarKW6EE4DWlamZ59qMwXp7JXImRDASxOTGs9hjzwpH0ONnoULZYhYUdZmALqvT0KW CDtEkNV/DupSGI8EQGJEcrl8w+fHFAcv83j5aPcKOkW5B0t/gp7uYxQZdodHLz0ycyGX JGJXer77ubxaN1eb6XlA0sGlx2AGiFDe2+yHBhTSP/ufHgokOaOHU81qgMaW4DjPpnTy mJ2nSjtJWF29SCBCjzmjfn8kSwF5xV1T25adzbWiM2pp7wiQcbw5/42R/c5MEI2YDeyV 8w== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3s6tyv89qy-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 01 Aug 2023 04:41:37 +0000 Received: from m0356517.ppops.net (m0356517.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 3714cOcw025331; Tue, 1 Aug 2023 04:41:32 GMT Received: from ppma21.wdc07v.mail.ibm.com (5b.69.3da9.ip4.static.sl-reverse.com [169.61.105.91]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3s6tyv89nq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 01 Aug 2023 04:41:32 +0000 Received: from pps.filterd (ppma21.wdc07v.mail.ibm.com [127.0.0.1]) by ppma21.wdc07v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 3714BCY2015559; Tue, 1 Aug 2023 04:41:30 GMT Received: from smtprelay03.dal12v.mail.ibm.com ([172.16.1.5]) by ppma21.wdc07v.mail.ibm.com (PPS) with ESMTPS id 3s5e3mrvns-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 01 Aug 2023 04:41:30 +0000 Received: from smtpav03.wdc07v.mail.ibm.com (smtpav03.wdc07v.mail.ibm.com [10.39.53.230]) by smtprelay03.dal12v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 3714fTlg59900236 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 1 Aug 2023 04:41:30 GMT Received: from smtpav03.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9E9ED5805A; Tue, 1 Aug 2023 04:41:29 +0000 (GMT) Received: from smtpav03.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id F18275805C; Tue, 1 Aug 2023 04:41:25 +0000 (GMT) Received: from skywalker.in.ibm.com (unknown [9.109.212.144]) by smtpav03.wdc07v.mail.ibm.com (Postfix) with ESMTP; Tue, 1 Aug 2023 04:41:25 +0000 (GMT) From: "Aneesh Kumar K.V" To: linux-mm@kvack.org, akpm@linux-foundation.org, mpe@ellerman.id.au, linuxppc-dev@lists.ozlabs.org, npiggin@gmail.com, christophe.leroy@csgroup.eu Cc: Oscar Salvador , David Hildenbrand , Michal Hocko , Vishal Verma , "Aneesh Kumar K.V" Subject: [PATCH v7 1/7] mm/memory_hotplug: Simplify ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE kconfig Date: Tue, 1 Aug 2023 10:11:10 +0530 Message-ID: <20230801044116.10674-2-aneesh.kumar@linux.ibm.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230801044116.10674-1-aneesh.kumar@linux.ibm.com> References: <20230801044116.10674-1-aneesh.kumar@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: N8I0KUY9Hw8pO-oeV4l4EC8YdEUFsEnK X-Proofpoint-GUID: jtD-L55ADn4LA-7LrKsAnoJClKVRjHrF X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26 definitions=2023-08-01_02,2023-07-31_02,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 mlxlogscore=694 lowpriorityscore=0 adultscore=0 phishscore=0 bulkscore=0 priorityscore=1501 impostorscore=0 spamscore=0 suspectscore=0 clxscore=1015 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2306200000 definitions=main-2308010041 X-Rspamd-Queue-Id: 7087940004 X-Rspam-User: X-Stat-Signature: ka4oniikr8rfe3atsrz8ob4oirbw4z54 X-Rspamd-Server: rspam03 X-HE-Tag: 1690864906-913513 X-HE-Meta: U2FsdGVkX1/jqdaWJBcV9dafBCqD+wyOMvQyNTYGhmqC9MUHnsvfIQgTZefbcLDqypSSI8vghwso0iFNuZq2QaosznwaCibWPe0zt4vESqqbp+NQ8chj45GeehF7s6I2DFHGn3Uz8kQwURdGT1r1AkN/UULQl7TM2izS0g56hpx1NdanWRHj/p4AvSf2NKyXhwCiV5g3ZGlEOwQV47MOVAzd0Xqs6bb5FNdflkAn1SNl2chcya8xsj5WhekaYA5T7jMscB8UL6nIxqCzGrnkE9g1v3/Tog9a9IhP8ZdbIfw35+CM5YTekbYKGMXPKIodFn29GVSyCtIcFi1bYCGw4CwHRE7n28DxBSMlLS1H6Tx6iQJlf/2m2MCDi/7a3t1pe53gqfeQy85KiUryklv411t2Rrv2/oy4HDzTrQSVyB3nHZz8XtkQL6t+JvTpqWuTRs7nmvah/OZwEIXz9WI5QdFM8q8kyshLGAX+xcxJzM89DZYbJ9roPpUfo87g3BHVRLds1ZjX6j1sNchnEVfg0BpcJMk7RVOF+EsT9ucVezoOQxSVfWA9IOfrR2yiLES1+qWLDI7JAY4T8t+Qf3RMquinpavBAYyFlVrISIl3sEyeiGSGBpsXZHOPeXxybRuJAMQLc4qBNwJlVDswVGXHZkJCL6Yul3ubkVyaRs6X+37KHcewo6pYxifGCh99VPWUE0QGCCni075pgPgpX5Pu/GZni84HIbAF/xaQCZzdqVxnQFuBk7Tkt2tho49OcGNqotkz+WPRnES6cFAhB8EosXVBP7tz8HqfIGuE0HIKmFxyU6TcE+uzw1Azh7MenilEuaTXkSRd74Gz+tvsyuSj+MX65kgXvdL5JJZ8DAFK32RbDzqvBudaAAfNk/GHs4h6EXD65zvEAe2gyNbD65LW74Yrdy3vX4hR38YQ4X8LcGmJoFbG7JgA5P/V2OIUVlv/5D2AhTsFjcPk/D1tMmn oRc5dds2 h0GKZ878ZTRZ0fn5Rcw4wxR0vSaasjqaex0en/egbPfBi2F8rwAgCTlxqfZKsk38bZr1ksXZ4u3rRLQSkO4jFwv7LABvhyL4sQEg9gyLneq2rCCTHYh+zeerKBCM4ess2hXyhq8nJ4MjV/qFTtgpLNGTnNitYmsshWVSLsMLhZXuQ9m6AGr/nel0uAm6vMaOEMPZEwgr+QgvujIJiHn7GVw1w5A== 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: Instead of adding menu entry with all supported architectures, add mm/Kconfig variable and select the same from supported architectures. No functional change in this patch. Acked-by: David Hildenbrand Signed-off-by: Aneesh Kumar K.V --- arch/arm64/Kconfig | 4 +--- arch/x86/Kconfig | 4 +--- mm/Kconfig | 3 +++ 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index b1573257a4d6..0f749cfab8e6 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -78,6 +78,7 @@ config ARM64 select ARCH_INLINE_SPIN_UNLOCK_IRQ if !PREEMPTION select ARCH_INLINE_SPIN_UNLOCK_IRQRESTORE if !PREEMPTION select ARCH_KEEP_MEMBLOCK + select ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE select ARCH_USE_CMPXCHG_LOCKREF select ARCH_USE_GNU_PROPERTY select ARCH_USE_MEMTEST @@ -347,9 +348,6 @@ config GENERIC_CSUM config GENERIC_CALIBRATE_DELAY def_bool y -config ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE - def_bool y - config SMP def_bool y diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index 78224aa76409..d0258e92a8af 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -102,6 +102,7 @@ config X86 select ARCH_HAS_DEBUG_WX select ARCH_HAS_ZONE_DMA_SET if EXPERT select ARCH_HAVE_NMI_SAFE_CMPXCHG + select ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE select ARCH_MIGHT_HAVE_ACPI_PDC if ACPI select ARCH_MIGHT_HAVE_PC_PARPORT select ARCH_MIGHT_HAVE_PC_SERIO @@ -2610,9 +2611,6 @@ config ARCH_HAS_ADD_PAGES def_bool y depends on ARCH_ENABLE_MEMORY_HOTPLUG -config ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE - def_bool y - menu "Power management and ACPI options" config ARCH_HIBERNATION_HEADER diff --git a/mm/Kconfig b/mm/Kconfig index 5fe49c030961..721dc88423c7 100644 --- a/mm/Kconfig +++ b/mm/Kconfig @@ -571,6 +571,9 @@ config MHP_MEMMAP_ON_MEMORY endif # MEMORY_HOTPLUG +config ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE + bool + # Heavily threaded applications may benefit from splitting the mm-wide # page_table_lock, so that faults on different parts of the user address # space can be handled with less contention: split it at this NR_CPUS. From patchwork Tue Aug 1 04:41:14 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: 13335762 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 0A7ECC0015E for ; Tue, 1 Aug 2023 04:42:05 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 70ABE2800DD; Tue, 1 Aug 2023 00:42:04 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 6BC372800C8; Tue, 1 Aug 2023 00:42:04 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 582E32800DD; Tue, 1 Aug 2023 00:42:04 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 49D1D2800C8 for ; Tue, 1 Aug 2023 00:42:04 -0400 (EDT) Received: from smtpin12.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 1B5D6B2255 for ; Tue, 1 Aug 2023 04:42:04 +0000 (UTC) X-FDA: 81074288568.12.7D4CB22 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by imf13.hostedemail.com (Postfix) with ESMTP id AFF562000C for ; Tue, 1 Aug 2023 04:42:01 +0000 (UTC) Authentication-Results: imf13.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=FDfjJ7d5; dmarc=pass (policy=none) header.from=ibm.com; spf=pass (imf13.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=1690864921; 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=F4qcZEoTqwkRahHimypWFVri5q7pOMDH/5i6hbY2k60=; b=BlXxtXBQsRc++dgeBYslR2dlW5lsRGMTbQdO6lfPxx4tSnI+6pTNzLNMB8VTcXhiqZJYO4 QruAU6cxVgdLE+cADyysDRHXovW9DnCkqGFZucxYLGjeHWxiCbAGmOWMOCBfm/4NSIMCSf Yfa13zF5eVU3ab6OfEpi2mGyIAHU6eA= ARC-Authentication-Results: i=1; imf13.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=FDfjJ7d5; dmarc=pass (policy=none) header.from=ibm.com; spf=pass (imf13.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=1690864921; a=rsa-sha256; cv=none; b=YoLbJs0DmvPN3xpY4Msga65Bn7biO9ZDcpubIAMwjoEjMdH4o+wY8KIsveuFPTuMysYVSE fuNFzEUP3u02PrL2bSJvRg3H0ARZaxT1gmNqhfKfN+V8fPWMkGpEvJhmzOzf6ZsnnUN4J7 +7l728ynhBa21x1EDFQsGaqZdUhMulk= Received: from pps.filterd (m0353728.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3714cQHt027889; Tue, 1 Aug 2023 04:41:55 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=F4qcZEoTqwkRahHimypWFVri5q7pOMDH/5i6hbY2k60=; b=FDfjJ7d5ogBaUqPsZlbd2E2h5DYUeI366BywS53lF9nANT1Xxmod+Oj0dF4SAxjpQg+F oYu8y557y+xC7IBQDzTdxlIgHN8XA40ZI81Kx/sD/D+O96OVcaEhHr1DdPdKOlG7FtD7 C7RIhY9BKxDaCSCqutvu1cur2AnXGitEu6VnJdY9Ummyj1vkbilbji3GhWb5DV6cjI9B kqTwyfDpapiAGsQCT8SPgcWS+UDiFXFQlMYZ2x7rBVqL0yrm7yWnBTrju/Nf8oc5rKTr EW0sRMyl+jhHLo6pUv2ArwF092YS+nmZToBoaKJxVJ0hJErAht0uz3R8VwODzbprJ18b JQ== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3s6u1a8acn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 01 Aug 2023 04:41:54 +0000 Received: from m0353728.ppops.net (m0353728.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 3714dBko032624; Tue, 1 Aug 2023 04:41:53 GMT Received: from ppma21.wdc07v.mail.ibm.com (5b.69.3da9.ip4.static.sl-reverse.com [169.61.105.91]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3s6u1a8a32-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 01 Aug 2023 04:41:53 +0000 Received: from pps.filterd (ppma21.wdc07v.mail.ibm.com [127.0.0.1]) by ppma21.wdc07v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 3713o80n015578; Tue, 1 Aug 2023 04:41:47 GMT Received: from smtprelay07.dal12v.mail.ibm.com ([172.16.1.9]) by ppma21.wdc07v.mail.ibm.com (PPS) with ESMTPS id 3s5e3mrvrm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 01 Aug 2023 04:41:47 +0000 Received: from smtpav03.wdc07v.mail.ibm.com (smtpav03.wdc07v.mail.ibm.com [10.39.53.230]) by smtprelay07.dal12v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 3714fkjh35390140 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 1 Aug 2023 04:41:47 GMT Received: from smtpav03.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9546458064; Tue, 1 Aug 2023 04:41:46 +0000 (GMT) Received: from smtpav03.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E8A565805D; Tue, 1 Aug 2023 04:41:42 +0000 (GMT) Received: from skywalker.in.ibm.com (unknown [9.109.212.144]) by smtpav03.wdc07v.mail.ibm.com (Postfix) with ESMTP; Tue, 1 Aug 2023 04:41:42 +0000 (GMT) From: "Aneesh Kumar K.V" To: linux-mm@kvack.org, akpm@linux-foundation.org, mpe@ellerman.id.au, linuxppc-dev@lists.ozlabs.org, npiggin@gmail.com, christophe.leroy@csgroup.eu Cc: Oscar Salvador , David Hildenbrand , Michal Hocko , Vishal Verma , "Aneesh Kumar K.V" Subject: [PATCH v7 5/7] powerpc/book3s64/memhotplug: Enable memmap on memory for radix Date: Tue, 1 Aug 2023 10:11:14 +0530 Message-ID: <20230801044116.10674-6-aneesh.kumar@linux.ibm.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230801044116.10674-1-aneesh.kumar@linux.ibm.com> References: <20230801044116.10674-1-aneesh.kumar@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: 9IXT-r0n7-ziHT5f4ToZV-7Q60ZuhYQx X-Proofpoint-GUID: OfD5AOrkufi3u5P3Spvtha__jRmyWQWD X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26 definitions=2023-08-01_02,2023-07-31_02,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 mlxlogscore=999 spamscore=0 bulkscore=0 phishscore=0 priorityscore=1501 mlxscore=0 malwarescore=0 impostorscore=0 clxscore=1015 adultscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2306200000 definitions=main-2308010041 X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: AFF562000C X-Stat-Signature: am3cai3aszm9nmjc3a3uric1j9m1pgf6 X-Rspam-User: X-HE-Tag: 1690864921-607433 X-HE-Meta: U2FsdGVkX19DV1PsGjISG+V1rVwZoCVx8+vYwCIolr3SQDAufyadUh59qx8xFQfzR2sZX+vtSGjlwilaP2ggHvqWvhq/K8LskzQxIIyLmNrT/b473YGN87nRlVQthRLF/Luo8vqqI7I/gFVTeLXpuRiY6rNqWgX4z1uVKkDk+IEx2R3gkic3zbQyM9Nl4mgW+5+Ok0PpEiKhWwhuVdpleZe0Tx4hDEuuJQ3qIGUvDzI6/9gLhfXg7XAk6VLb4jt7MMu3vL6fHBYcF/ETUxjjcwqPUOKQs7O9pZinyPWwl30MFF9sxzbNUJKkdaZkxlNvMtGoyZcMYf6KD7VDtN+7kr9EP3KgvixOSAJyam2Bt1DSyL+wtSG9roo9RFWPa/mgWLOdRNqc8BPOT3LCJAGxHZy+RhSd+loIXjqypCAnzxedo65KrtRGmy1DIFw2bZ91s7CBzujPwS2pJ1FoldIjK0yRXugkx59skUixVwp30VLnfdi9UoCw6yuo/pXDbhMxnyOh0PF8BgXkki3M/mlJlJj04488+P4N4of6SwhGtwTwzBkFjRvGG7vHx+2Umuocq9jLvLa35W+W758HxuWpbvNhhhU7/VfSOkZBgCzjVxgg16+B3yK7fRn9GrbcucOEAuhIYAh4Ye6mm+Otf9DMWLwGXhjLlIbagdBwFJHxn5TUsCFoq8M1xDMgn16KMbyP2Z3sXOmyjQWJ2PE2tVDGzOLF0Gy8KSgFAvBTbVZmojlOVVjg4T681uSVX9FtJP21+XV4T43yS7w+qeF/uR77q6A4CsjZNdbJEC6gdb6ikgZZ0ue/hFlzvgg0of5I4wjBjD82yEuLGpuebRHQ7MpK0qnM1DGrjvE5F8OCpYUrZeWVfe1uldEp/zf6KQF2e3wXkJXcOnmSwIXnQEb9hmYNoflrNsvGFRZBsVgJjtaCeismNarywDo/41TAvOwOkcVWJ1kRbigrSs68ucWYzmr Fu3Wcnbh xEdXU1Vd1YW2QxabWsiC9i16yQJXTkIPMyDMxAgn3lXQjJVclrRduioqsU/iIESm/b99HOztkJRMswzydkKeNZlGPRi1I2l7df3E25orGsUh5CfQ10vE0x2DURAni8eHHWRa/LVkrK65WJMTI6507yiWGkU5tAxe3Cqhidd/vbB0k+54= 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: Radix vmemmap mapping can map things correctly at the PMD level or PTE level based on different device boundary checks. Hence we skip the restrictions w.r.t vmemmap size to be multiple of PMD_SIZE. This also makes the feature widely useful because to use PMD_SIZE vmemmap area we require a memory block size of 2GiB We can also use MHP_RESERVE_PAGES_MEMMAP_ON_MEMORY to that the feature can work with a memory block size of 256MB. Using altmap.reserve feature to align things correctly at pageblock granularity. We can end up losing some pages in memory with this. For ex: with a 256MiB memory block size, we require 4 pages to map vmemmap pages, In order to align things correctly we end up adding a reserve of 28 pages. ie, for every 4096 pages 28 pages get reserved. Reviewed-by: David Hildenbrand Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/Kconfig | 1 + arch/powerpc/include/asm/pgtable.h | 21 +++++++++++++++++++ .../platforms/pseries/hotplug-memory.c | 2 +- 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig index d0497d13f5b4..938294c996dc 100644 --- a/arch/powerpc/Kconfig +++ b/arch/powerpc/Kconfig @@ -157,6 +157,7 @@ config PPC select ARCH_HAS_UBSAN_SANITIZE_ALL select ARCH_HAVE_NMI_SAFE_CMPXCHG select ARCH_KEEP_MEMBLOCK + select ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE if PPC_RADIX_MMU select ARCH_MIGHT_HAVE_PC_PARPORT select ARCH_MIGHT_HAVE_PC_SERIO select ARCH_OPTIONAL_KERNEL_RWX if ARCH_HAS_STRICT_KERNEL_RWX diff --git a/arch/powerpc/include/asm/pgtable.h b/arch/powerpc/include/asm/pgtable.h index a4893b17705a..33464e6d6431 100644 --- a/arch/powerpc/include/asm/pgtable.h +++ b/arch/powerpc/include/asm/pgtable.h @@ -161,6 +161,27 @@ static inline pgtable_t pmd_pgtable(pmd_t pmd) int __meminit vmemmap_populated(unsigned long vmemmap_addr, int vmemmap_map_size); bool altmap_cross_boundary(struct vmem_altmap *altmap, unsigned long start, unsigned long page_size); +/* + * mm/memory_hotplug.c:mhp_supports_memmap_on_memory goes into details + * some of the restrictions. We don't check for PMD_SIZE because our + * vmemmap allocation code can fallback correctly. The pageblock + * alignment requirement is met using altmap->reserve blocks. + */ +#define arch_supports_memmap_on_memory arch_supports_memmap_on_memory +static inline bool arch_supports_memmap_on_memory(unsigned long vmemmap_size) +{ + if (!radix_enabled()) + return false; + /* + * With 4K page size and 2M PMD_SIZE, we can align + * things better with memory block size value + * starting from 128MB. Hence align things with PMD_SIZE. + */ + if (IS_ENABLED(CONFIG_PPC_4K_PAGES)) + return IS_ALIGNED(vmemmap_size, PMD_SIZE); + return true; +} + #endif /* CONFIG_PPC64 */ #endif /* __ASSEMBLY__ */ diff --git a/arch/powerpc/platforms/pseries/hotplug-memory.c b/arch/powerpc/platforms/pseries/hotplug-memory.c index 9c62c2c3b3d0..4f3d6a2f9065 100644 --- a/arch/powerpc/platforms/pseries/hotplug-memory.c +++ b/arch/powerpc/platforms/pseries/hotplug-memory.c @@ -637,7 +637,7 @@ static int dlpar_add_lmb(struct drmem_lmb *lmb) nid = first_online_node; /* Add the memory */ - rc = __add_memory(nid, lmb->base_addr, block_sz, MHP_NONE); + rc = __add_memory(nid, lmb->base_addr, block_sz, MHP_MEMMAP_ON_MEMORY); if (rc) { invalidate_lmb_associativity_index(lmb); return rc;