mirror of
https://github.com/torvalds/linux.git
synced 2024-11-26 14:12:06 +00:00
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>
This commit is contained in:
parent
a1748f85be
commit
47e61d8874
@ -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)));
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user