Skip to content

Commit

Permalink
mm: hugetlb_vmemmap: add check of CONFIG_MEMORY_HOTPLUG back
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Muchun Song authored and Andrew Morton committed Dec 12, 2023
1 parent a1748f8 commit 47e61d8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mm/hugetlb_vmemmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)));

Expand Down

0 comments on commit 47e61d8

Please sign in to comment.