Skip to contentSkip to conversation

mm/page_ext: remove pgdat_page_ext_init()

PATCH Superseded Sang-Heon Jeon 2 participants 3 messages Aug 3 – Aug 4

Subsystems (4)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mm/page_ext: remove pgdat_page_ext_init()

pgdat_page_ext_init() sets pgdat->node_page_ext to NULL only on FLATMEM. FLATMEM depends on !NUMA on every architecture, so the pgdat is always the zero-initialized contig_page_data and the store has no effect.

So remove the call site, the unused function and its declaration.

No functional change.

---
 include/linux/page_ext.h | 5 -----
 mm/mm_init.c             | 1 -
 mm/page_ext.c            | 9 ---------
 3 files changed, 15 deletions(-)
include/linux/page_ext.h +0 -5
index f23d4b218da0..79c53ec45dfa 100644
@@ -55,7 +55,6 @@ struct page_ext {
 
 extern bool early_page_ext;
 extern unsigned long page_ext_size;
-extern void pgdat_page_ext_init(struct pglist_data *pgdat);
 
 static inline bool early_page_ext_enabled(void)
 {
@@ -202,10 +201,6 @@ static inline bool early_page_ext_enabled(void)
 	return false;
 }
 
-static inline void pgdat_page_ext_init(struct pglist_data *pgdat)
-{
-}
-
 static inline void page_ext_init(void)
 {
 }
mm/mm_init.c +0 -1
index 711f821f7b3c..e9c4204b73ad 100644
@@ -1394,7 +1394,6 @@ static void __meminit pgdat_init_internals(struct pglist_data *pgdat)
 	for (i = 0; i < NR_VMSCAN_THROTTLE; i++)
 		init_waitqueue_head(&pgdat->reclaim_wait[i]);
 
-	pgdat_page_ext_init(pgdat);
 	lruvec_init(&pgdat->__lruvec);
 }
 
mm/page_ext.c +0 -9
index e2e92bd27ebd..b679a8c1f7d7 100644
@@ -164,11 +164,6 @@ void __init page_ext_init_flatmem_late(void)
 	invoke_init_callbacks();
 }
 
-void __meminit pgdat_page_ext_init(struct pglist_data *pgdat)
-{
-	pgdat->node_page_ext = NULL;
-}
-
 static struct page_ext *lookup_page_ext(const struct page *page)
 {
 	unsigned long pfn = page_to_pfn(page);
@@ -494,10 +489,6 @@ void __init page_ext_init(void)
 	panic("Out of memory");
 }
 
-void __meminit pgdat_page_ext_init(struct pglist_data *pgdat)
-{
-}
-
 #endif
 
 /**
Signature · 1 line
2.43.0
reviewer
#1 lore raw
Quoted 2 lines · Sang-Heon Jeon

pgdat_page_ext_init() sets pgdat->node_page_ext to NULL only on FLATMEM. FLATMEM depends on !NUMA on every architecture, so the

Should we add "depends on !NUMA" to FLATMEM and FLATMEM_MANUAL to prevent FLATMEM + NUMA being possible? Otherwise, FLATMEM + NUMA can have issues with pgdat_page_ext_init() being removed. I understand that no arch supports FLATMEM + NUMA.

Quoted 76 lines

pgdat is always the zero-initialized contig_page_data and the store has no effect.

So remove the call site, the unused function and its declaration.

No functional change.

---
 include/linux/page_ext.h | 5 -----
 mm/mm_init.c             | 1 -
 mm/page_ext.c            | 9 ---------
 3 files changed, 15 deletions(-)
include/linux/page_ext.h +0 -5
index f23d4b218da0..79c53ec45dfa 100644
@@ -55,7 +55,6 @@ struct page_ext {
 
 extern bool early_page_ext;
 extern unsigned long page_ext_size;
-extern void pgdat_page_ext_init(struct pglist_data *pgdat);
 
 static inline bool early_page_ext_enabled(void)
 {
@@ -202,10 +201,6 @@ static inline bool early_page_ext_enabled(void)
 	return false;
 }
 
-static inline void pgdat_page_ext_init(struct pglist_data *pgdat)
-{
-}
-
 static inline void page_ext_init(void)
 {
 }
mm/mm_init.c +0 -1
index 711f821f7b3c..e9c4204b73ad 100644
@@ -1394,7 +1394,6 @@ static void __meminit pgdat_init_internals(struct pglist_data *pgdat)
 	for (i = 0; i < NR_VMSCAN_THROTTLE; i++)
 		init_waitqueue_head(&pgdat->reclaim_wait[i]);
 
-	pgdat_page_ext_init(pgdat);
 	lruvec_init(&pgdat->__lruvec);
 }
 
mm/page_ext.c +0 -9
index e2e92bd27ebd..b679a8c1f7d7 100644
@@ -164,11 +164,6 @@ void __init page_ext_init_flatmem_late(void)
 	invoke_init_callbacks();
 }
 
-void __meminit pgdat_page_ext_init(struct pglist_data *pgdat)
-{
-	pgdat->node_page_ext = NULL;
-}
-
 static struct page_ext *lookup_page_ext(const struct page *page)
 {
 	unsigned long pfn = page_to_pfn(page);
@@ -494,10 +489,6 @@ void __init page_ext_init(void)
 	panic("Out of memory");
 }
 
-void __meminit pgdat_page_ext_init(struct pglist_data *pgdat)
-{
-}
-
 #endif
 
 /**
Signature · 2 lines
Best Regards,
Yan, Zi
#2 lore raw

Hello,

Quoted 9 lines · Zi Yan
Quoted 2 lines · Sang-Heon Jeon

pgdat_page_ext_init() sets pgdat->node_page_ext to NULL only on FLATMEM. FLATMEM depends on !NUMA on every architecture, so the

Should we add "depends on !NUMA" to FLATMEM and FLATMEM_MANUAL to prevent FLATMEM + NUMA being possible? Otherwise, FLATMEM + NUMA can have issues with pgdat_page_ext_init() being removed. I understand that no arch supports FLATMEM + NUMA.

Indeed. Existing NUMA code depends on SPARSEMEM-only macro, So FLATMEM
+ NUMA is not buildable. Making the constraint explicit sounds good to me. I will address it in v2.

Quoted 75 lines
Quoted 75 lines

pgdat is always the zero-initialized contig_page_data and the store has no effect.

So remove the call site, the unused function and its declaration.

No functional change.

---
 include/linux/page_ext.h | 5 -----
 mm/mm_init.c             | 1 -
 mm/page_ext.c            | 9 ---------
 3 files changed, 15 deletions(-)
include/linux/page_ext.h +0 -5
index f23d4b218da0..79c53ec45dfa 100644
@@ -55,7 +55,6 @@ struct page_ext {
 
 extern bool early_page_ext;
 extern unsigned long page_ext_size;
-extern void pgdat_page_ext_init(struct pglist_data *pgdat);
 
 static inline bool early_page_ext_enabled(void)
 {
@@ -202,10 +201,6 @@ static inline bool early_page_ext_enabled(void)
      return false;
 }
 
-static inline void pgdat_page_ext_init(struct pglist_data *pgdat)
-{
-}
-
 static inline void page_ext_init(void)
 {
 }
mm/mm_init.c +0 -1
index 711f821f7b3c..e9c4204b73ad 100644
@@ -1394,7 +1394,6 @@ static void __meminit pgdat_init_internals(struct pglist_data *pgdat)
      for (i = 0; i < NR_VMSCAN_THROTTLE; i++)
              init_waitqueue_head(&pgdat->reclaim_wait[i]);
 
-     pgdat_page_ext_init(pgdat);
      lruvec_init(&pgdat->__lruvec);
 }
 
mm/page_ext.c +0 -9
index e2e92bd27ebd..b679a8c1f7d7 100644
@@ -164,11 +164,6 @@ void __init page_ext_init_flatmem_late(void)
      invoke_init_callbacks();
 }
 
-void __meminit pgdat_page_ext_init(struct pglist_data *pgdat)
-{
-     pgdat->node_page_ext = NULL;
-}
-
 static struct page_ext *lookup_page_ext(const struct page *page)
 {
      unsigned long pfn = page_to_pfn(page);
@@ -494,10 +489,6 @@ void __init page_ext_init(void)
      panic("Out of memory");
 }
 
-void __meminit pgdat_page_ext_init(struct pglist_data *pgdat)
-{
-}
-
 #endif
 
Quoted 9 lines

mm/page_ext.c void __init page_ext_init(void) · line 494

Quoted 1 line
mm/page_ext.c +0 -0
 /**

--
Best Regards,
Yan, Zi

Best Regards,
Sang-Heon Jeon