Muchun Song 6e02c46b4d mm: memory_hotplug: override memmap_on_memory when hugetlb_free_vmemmap=on
Optimizing HugeTLB vmemmap pages is not compatible with allocating memmap
on hot added memory.  If "hugetlb_free_vmemmap=on" and
memory_hotplug.memmap_on_memory" are both passed on the kernel command
line, optimizing hugetlb pages takes precedence.  However, the global
variable memmap_on_memory will still be set to 1, even though we will not
try to allocate memmap on hot added memory.

Also introduce mhp_memmap_on_memory() helper to move the definition of
"memmap_on_memory" to the scope of CONFIG_MHP_MEMMAP_ON_MEMORY.  In the
next patch, mhp_memmap_on_memory() will also be exported to be used in
hugetlb_vmemmap.c.

Link: https://lkml.kernel.org/r/20220512041142.39501-3-songmuchun@bytedance.com
Signed-off-by: Muchun Song <songmuchun@bytedance.com>
Acked-by: Mike Kravetz <mike.kravetz@oracle.com>
Cc: David Hildenbrand <david@redhat.com>
Cc: Iurii Zaikin <yzaikin@google.com>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Kees Cook <keescook@chromium.org>
Cc: Luis Chamberlain <mcgrof@kernel.org>
Cc: Masahiro Yamada <masahiroy@kernel.org>
Cc: Oscar Salvador <osalvador@suse.de>
Cc: Xiongchun Duan <duanxiongchun@bytedance.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2022-05-13 16:48:56 -07:00
..
2022-03-24 19:06:45 -07:00
2022-03-22 15:57:01 -07:00
2022-05-13 07:20:09 -07:00
2022-05-13 07:20:09 -07:00
2022-02-14 19:51:47 +01:00
2022-01-15 16:30:28 +02:00
2022-03-23 18:03:08 -07:00
2022-05-13 07:20:15 -07:00
2022-05-13 07:20:09 -07:00
2022-03-22 17:03:12 -07:00
2022-04-01 14:40:42 -04:00
2022-03-22 18:26:56 -07:00
2022-05-09 18:20:47 -07:00
2022-04-28 23:16:16 -07:00
2022-01-15 16:30:31 +02:00
2022-05-09 18:20:47 -07:00