]> www.infradead.org Git - users/jedix/linux-maple.git/commit
mm: hugetlb_vmemmap: optimize vmemmap_optimize_mode handling
authorMuchun Song <songmuchun@bytedance.com>
Tue, 28 Jun 2022 09:22:29 +0000 (17:22 +0800)
committerakpm <akpm@linux-foundation.org>
Wed, 20 Jul 2022 21:41:30 +0000 (14:41 -0700)
commit078c4621934ff3c1fc8c989a894d0ed217d6f256
tree3502ebe623e9c0838874c9eedac10b99ac48f09e
parent1fe3e87f07cd10053ddc95516bc0e87c6244ab1d
mm: hugetlb_vmemmap: optimize vmemmap_optimize_mode handling

We hold an another reference to hugetlb_optimize_vmemmap_key when making
vmemmap_optimize_mode on, because we use static_key to tell memory_hotplug
that memory_hotplug.memmap_on_memory should be overridden.  However, this
rule has gone when we have introduced PageVmemmapSelfHosted.  Therefore,
we could simplify vmemmap_optimize_mode handling by not holding an another
reference to hugetlb_optimize_vmemmap_key.  This also means that we not
incur the extra page_fixed_fake_head checks if there are no vmemmap
optinmized hugetlb pages after this change.

Link: https://lkml.kernel.org/r/20220628092235.91270-3-songmuchun@bytedance.com
Signed-off-by: Muchun Song <songmuchun@bytedance.com>
Reviewed-by: Oscar Salvador <osalvador@suse.de>
Reviewed-by: Mike Kravetz <mike.kravetz@oracle.com>
Cc: Anshuman Khandual <anshuman.khandual@arm.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: David Hildenbrand <david@redhat.com>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Will Deacon <will@kernel.org>
Cc: Xiongchun Duan <duanxiongchun@bytedance.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
include/linux/page-flags.h
mm/hugetlb_vmemmap.c