]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
mm: memory_hotplug: disable memmap_on_memory when hugetlb_free_vmemmap enabled
authorMuchun Song <songmuchun@bytedance.com>
Wed, 2 Jun 2021 03:52:43 +0000 (13:52 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 2 Jun 2021 03:52:43 +0000 (13:52 +1000)
The parameter of memory_hotplug.memmap_on_memory is not compatible with
hugetlb_free_vmemmap.  So disable it when hugetlb_free_vmemmap is enabled.

Link: https://lkml.kernel.org/r/20210510030027.56044-9-songmuchun@bytedance.com
Signed-off-by: Muchun Song <songmuchun@bytedance.com>
Acked-by: Mike Kravetz <mike.kravetz@oracle.com>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Anshuman Khandual <anshuman.khandual@arm.com>
Cc: Balbir Singh <bsingharora@gmail.com>
Cc: Barry Song <song.bao.hua@hisilicon.com>
Cc: Bodeddula Balasubramaniam <bodeddub@amazon.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Chen Huang <chenhuang5@huawei.com>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: David Hildenbrand <david@redhat.com>
Cc: David Rientjes <rientjes@google.com>
Cc: HORIGUCHI NAOYA <naoya.horiguchi@nec.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Joao Martins <joao.m.martins@oracle.com>
Cc: Joerg Roedel <jroedel@suse.de>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Matthew Wilcox <willy@infradead.org>
Cc: Miaohe Lin <linmiaohe@huawei.com>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Mina Almasry <almasrymina@google.com>
Cc: Oliver Neukum <oneukum@suse.com>
Cc: Oscar Salvador <osalvador@suse.de>
Cc: Paul E. McKenney <paulmck@kernel.org>
Cc: Pawan Gupta <pawan.kumar.gupta@linux.intel.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Randy Dunlap <rdunlap@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Xiongchun Duan <duanxiongchun@bytedance.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Documentation/admin-guide/kernel-parameters.txt
drivers/acpi/acpi_memhotplug.c
mm/memory_hotplug.c

index 749bec0fe2d7b1a03d2b1f576cb5dfe8898fe5c8..e4accf5a202cb62d22fb250d7f7ec747acb5592e 100644 (file)
                        on:  enable the feature
                        off: disable the feature
 
+                       This is not compatible with memory_hotplug.memmap_on_memory.
+                       If both parameters are enabled, hugetlb_free_vmemmap takes
+                       precedence over memory_hotplug.memmap_on_memory.
+
        hung_task_panic=
                        [KNL] Should the hung task detector generate panics.
                        Format: 0 | 1
                        Note that even when enabled, there are a few cases where
                        the feature is not effective.
 
+                       This is not compatible with hugetlb_free_vmemmap. If
+                       both parameters are enabled, hugetlb_free_vmemmap takes
+                       precedence over memory_hotplug.memmap_on_memory.
+
        memtest=        [KNL,X86,ARM,PPC,RISCV] Enable memtest
                        Format: <integer>
                        default : 0 <disable>
index 8cc195c4c86191980b76dddd4f5425cfd9ed6ca7..0d7f595ee441f6155512c28d029b85888127fe95 100644 (file)
@@ -15,6 +15,7 @@
 #include <linux/acpi.h>
 #include <linux/memory.h>
 #include <linux/memory_hotplug.h>
+#include <linux/hugetlb.h>
 
 #include "internal.h"
 
index ae7a07b02049558e6c146435515cb5d04132d9a1..29d1d742b56549c5167224fce786c2f1ade3f457 100644 (file)
@@ -1056,6 +1056,7 @@ bool mhp_supports_memmap_on_memory(unsigned long size)
         *       populate a single PMD.
         */
        return memmap_on_memory &&
+              !is_hugetlb_free_vmemmap_enabled() &&
               IS_ENABLED(CONFIG_MHP_MEMMAP_ON_MEMORY) &&
               size == memory_block_size_bytes() &&
               IS_ALIGNED(vmemmap_size, PMD_SIZE) &&