diff options
author | Muchun Song <songmuchun@bytedance.com> | 2023-12-05 11:05:30 +0800 |
---|---|---|
committer | Andrew Morton <akpm@linux-foundation.org> | 2023-12-12 10:57:08 -0800 |
commit | 47e61d8874cca8070d4f9295819876c18b5207b2 (patch) | |
tree | 300411ac8699adae90e5138bb732252b102da7da /mm/hugetlb_vmemmap.c | |
parent | a1748f85bec936d87cac8a9785fb2a38147fc998 (diff) | |
download | linux-stable-47e61d8874cca8070d4f9295819876c18b5207b2.tar.gz linux-stable-47e61d8874cca8070d4f9295819876c18b5207b2.tar.bz2 linux-stable-47e61d8874cca8070d4f9295819876c18b5207b2.zip |
mm: hugetlb_vmemmap: add check of CONFIG_MEMORY_HOTPLUG back
The compiler will optimize the code as much as possible if we add the
check of CONFIG_MEMORY_HOTPLUG back.
Link: https://lkml.kernel.org/r/20231205030530.3802-1-songmuchun@bytedance.com
Signed-off-by: Muchun Song <songmuchun@bytedance.com>
Cc: Mike Kravetz <mike.kravetz@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'mm/hugetlb_vmemmap.c')
-rw-r--r-- | mm/hugetlb_vmemmap.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/mm/hugetlb_vmemmap.c b/mm/hugetlb_vmemmap.c index 54f388aa361f..2646a2798a0e 100644 --- a/mm/hugetlb_vmemmap.c +++ b/mm/hugetlb_vmemmap.c @@ -119,7 +119,7 @@ static int vmemmap_pmd_entry(pmd_t *pmd, unsigned long addr, * +--+ | | * +------------------------+ */ - if (unlikely(!vmemmap_walk->nr_walked)) { + if (IS_ENABLED(CONFIG_MEMORY_HOTPLUG) && unlikely(!vmemmap_walk->nr_walked)) { struct page *page = head ? head + pte_index(addr) : pte_page(ptep_get(pte_offset_kernel(pmd, addr))); |