Skip to contentSkip to conversation

mm/page_ext: remove pgdat_page_ext_init()

PATCH Applied Sang-Heon Jeon 4 participants 8 messages Aug 4 – Aug 5

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

v2 cover mm/page_ext: remove pgdat_page_ext_init()

Hello,

pgdat_page_ext_init() has no effect on FLATMEM. The pgdat is always the zero-initialized contig_page_data, because no architecture supports FLATMEM + NUMA.

That constraint is only implicit in the arch Kconfig files. So patch 1 makes it explicit in mm/Kconfig, and patch 2 removes pgdat_page_ext_init().

No functional change.

---
Changes from v1 [1]
- Add patch 1 to make FLATMEM depend on !NUMA

[1] https://lore.kernel.org/all/[email protected]/
---

Sang-Heon Jeon (2):
mm/Kconfig: make FLATMEM depend on !NUMA
mm/page_ext: remove pgdat_page_ext_init()

 include/linux/page_ext.h | 5 -----
 mm/Kconfig               | 2 ++
 mm/mm_init.c             | 1 -
 mm/page_ext.c            | 9 ---------
 4 files changed, 2 insertions(+), 15 deletions(-)
Signature · 1 line
2.43.0
#1 lore raw

PATCH v2 1/2 mm/Kconfig: make FLATMEM depend on !NUMA

FLATMEM + NUMA is not supported by any architecture and fails to build. The constraint is only implicit in the arch Kconfig files.

So make it explicit in mm/Kconfig.

No functional change.

---
 mm/Kconfig | 2 ++
 1 file changed, 2 insertions(+)
mm/Kconfig +2 -0
index 060190e12bce..331daf7fcfab 100644
@@ -390,6 +390,7 @@ choice
 
 config FLATMEM_MANUAL
 	bool "Flat Memory"
+	depends on !NUMA
 	depends on !ARCH_SPARSEMEM_ENABLE || ARCH_FLATMEM_ENABLE
 	help
 	  This option is best suited for non-NUMA systems with
@@ -424,6 +425,7 @@ config SPARSEMEM
 
 config FLATMEM
 	def_bool y
+	depends on !NUMA
 	depends on !SPARSEMEM || FLATMEM_MANUAL
 
 #
Signature · 1 line
2.43.0
reviewer Acked-by on v2 1/2
#2 lore raw

Re: [PATCH v2 1/2] mm/Kconfig: make FLATMEM depend on !NUMA

Quoted 5 lines · Sang-Heon Jeon

FLATMEM + NUMA is not supported by any architecture and fails to build. The constraint is only implicit in the arch Kconfig files.

So make it explicit in mm/Kconfig.

Quoted 7 lines

No functional change.

---
 mm/Kconfig | 2 ++
 1 file changed, 2 insertions(+)

Hopefully no new arch will try to support it.

Quoted 21 lines
mm/Kconfig +2 -0
index 060190e12bce..331daf7fcfab 100644
@@ -390,6 +390,7 @@ choice
 
 config FLATMEM_MANUAL
 	bool "Flat Memory"
+	depends on !NUMA
 	depends on !ARCH_SPARSEMEM_ENABLE || ARCH_FLATMEM_ENABLE
 	help
 	  This option is best suited for non-NUMA systems with
@@ -424,6 +425,7 @@ config SPARSEMEM
 
 config FLATMEM
 	def_bool y
+	depends on !NUMA
 	depends on !SPARSEMEM || FLATMEM_MANUAL
 
 #
Signature · 2 lines
Best Regards,
Yan, Zi
maintainer Acked-by on v2 1/2
#3 lore raw

Re: [PATCH v2 1/2] mm/Kconfig: make FLATMEM depend on !NUMA

In reply to Sang-Heon Jeon
Quoted 9 lines · Sang-Heon Jeon

FLATMEM + NUMA is not supported by any architecture and fails to build. The constraint is only implicit in the arch Kconfig files.

So make it explicit in mm/Kconfig.

No functional change.

Quoted 3 lines
---
 mm/Kconfig | 2 ++
 1 file changed, 2 insertions(+)
Signature · 2 lines
Sincerely yours,
Mike.
maintainer Acked-by on v2 1/2
#4 lore raw

Re: [PATCH v2 1/2] mm/Kconfig: make FLATMEM depend on !NUMA

In reply to Sang-Heon Jeon
Quoted 10 lines · Sang-Heon Jeon

FLATMEM + NUMA is not supported by any architecture and fails to build. The constraint is only implicit in the arch Kconfig files.

So make it explicit in mm/Kconfig.

No functional change.

---

Is this survives the compile bots, perfect.

Signature · 3 lines
Cheers,

David
#5 lore raw

PATCH v2 2/2 mm/page_ext: remove pgdat_page_ext_init()

In reply to Sang-Heon Jeon

pgdat_page_ext_init() sets pgdat->node_page_ext to NULL only on FLATMEM. FLATMEM depends on !NUMA, 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 Acked-by on v2 2/2
#6 lore raw
Quoted 6 lines · Sang-Heon Jeon

pgdat_page_ext_init() sets pgdat->node_page_ext to NULL only on FLATMEM. FLATMEM depends on !NUMA, 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.

Quoted 9 lines

No functional change.

---
 include/linux/page_ext.h | 5 -----
 mm/mm_init.c             | 1 -
 mm/page_ext.c            | 9 ---------
 3 files changed, 15 deletions(-)

LGTM.

Signature · 2 lines
Best Regards,
Yan, Zi
maintainer Acked-by on v2 2/2
#7 lore raw
In reply to Sang-Heon Jeon
Quoted 10 lines · Sang-Heon Jeon

pgdat_page_ext_init() sets pgdat->node_page_ext to NULL only on FLATMEM. FLATMEM depends on !NUMA, 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.

---

Signature · 3 lines
Cheers,

David