* [PATCH] mm: hugetlb_vmemmap: add check of CONFIG_MEMORY_HOTPLUG back
@ 2023-12-05 3:05 Muchun Song
0 siblings, 0 replies; only message in thread
From: Muchun Song @ 2023-12-05 3:05 UTC (permalink / raw)
To: mike.kravetz, muchun.song, akpm; +Cc: linux-mm, linux-kernel, Muchun Song
The compiler will optimize the code as much as possible if we add
the check of CONFIG_MEMORY_HOTPLUG back.
Signed-off-by: Muchun Song <songmuchun@bytedance.com>
---
mm/hugetlb_vmemmap.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mm/hugetlb_vmemmap.c b/mm/hugetlb_vmemmap.c
index eb05596662d42..be1586a114ce1 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)));
--
2.20.1
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2023-12-05 3:06 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-05 3:05 [PATCH] mm: hugetlb_vmemmap: add check of CONFIG_MEMORY_HOTPLUG back Muchun Song
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox