From patchwork Thu Dec 17 13:07:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oscar Salvador X-Patchwork-Id: 11979777 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=-16.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT 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 775C8C4361B for ; Thu, 17 Dec 2020 13:08:11 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id E647B23976 for ; Thu, 17 Dec 2020 13:08:10 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E647B23976 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 6B8376B0074; Thu, 17 Dec 2020 08:08:10 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 63DED6B0071; Thu, 17 Dec 2020 08:08:10 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 52F406B0072; Thu, 17 Dec 2020 08:08:10 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0037.hostedemail.com [216.40.44.37]) by kanga.kvack.org (Postfix) with ESMTP id 3C1426B0070 for ; Thu, 17 Dec 2020 08:08:10 -0500 (EST) Received: from smtpin11.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 0B224180AD82F for ; Thu, 17 Dec 2020 13:08:10 +0000 (UTC) X-FDA: 77602802340.11.leaf05_53003d427435 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin11.hostedemail.com (Postfix) with ESMTP id E1E65180F8B80 for ; Thu, 17 Dec 2020 13:08:09 +0000 (UTC) X-HE-Tag: leaf05_53003d427435 X-Filterd-Recvd-Size: 3403 Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by imf08.hostedemail.com (Postfix) with ESMTP for ; Thu, 17 Dec 2020 13:08:09 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 4A688ACF9; Thu, 17 Dec 2020 13:08:08 +0000 (UTC) From: Oscar Salvador To: akpm@linux-foundation.org Cc: david@redhat.com, mhocko@kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, vbabka@suse.cz, pasha.tatashin@soleen.com, Oscar Salvador Subject: [PATCH 1/5] mm: Introduce ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE Date: Thu, 17 Dec 2020 14:07:54 +0100 Message-Id: <20201217130758.11565-2-osalvador@suse.de> X-Mailer: git-send-email 2.13.7 In-Reply-To: <20201217130758.11565-1-osalvador@suse.de> References: <20201217130758.11565-1-osalvador@suse.de> 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: In order to use self-hosted memmap array, the platform needs to have support for CONFIG_SPARSEMEM_VMEMMAP and altmap. Currently, only arm64, PPC and x86_64 have the support, so enable those platforms with ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE. ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE will be checked later on to see whether we can enable this feature or not. Signed-off-by: Oscar Salvador --- arch/arm64/Kconfig | 4 ++++ arch/powerpc/Kconfig | 4 ++++ arch/x86/Kconfig | 4 ++++ mm/Kconfig | 3 +++ 4 files changed, 15 insertions(+) diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index 33446269f692..2daa29ab9057 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -307,6 +307,10 @@ config ARCH_ENABLE_MEMORY_HOTPLUG config ARCH_ENABLE_MEMORY_HOTREMOVE def_bool y +config ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE + def_bool y + depends on MEMORY_HOTPLUG && SPARSEMEM_VMEMMAP_ENABLE + config SMP def_bool y diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig index 107bb4319e0e..30322105f145 100644 --- a/arch/powerpc/Kconfig +++ b/arch/powerpc/Kconfig @@ -527,6 +527,10 @@ config ARCH_ENABLE_MEMORY_HOTPLUG config ARCH_ENABLE_MEMORY_HOTREMOVE def_bool y +config ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE + def_bool y + depends on MEMORY_HOTPLUG && SPARSEMEM_VMEMMAP_ENABLE + config PPC64_SUPPORTS_MEMORY_FAILURE bool "Add support for memory hwpoison" depends on PPC_BOOK3S_64 diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index 42d84d86f1f4..742b29169b47 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -2443,6 +2443,10 @@ config ARCH_ENABLE_MEMORY_HOTREMOVE def_bool y depends on MEMORY_HOTPLUG +config ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE + def_bool y + depends on X86_64 && MEMORY_HOTPLUG && SPARSEMEM_VMEMMAP_ENABLE + config USE_PERCPU_NUMA_NODE_ID def_bool y depends on NUMA diff --git a/mm/Kconfig b/mm/Kconfig index 7af1a55b708e..6156114b7974 100644 --- a/mm/Kconfig +++ b/mm/Kconfig @@ -183,6 +183,9 @@ config MEMORY_HOTREMOVE depends on MEMORY_HOTPLUG && ARCH_ENABLE_MEMORY_HOTREMOVE depends on MIGRATION +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.