linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/2] mm/page_ext: remove pgdat_page_ext_init()
@ 2026-08-04 15:11 Sang-Heon Jeon
  2026-08-04 15:11 ` [PATCH v2 1/2] mm/Kconfig: make FLATMEM depend on !NUMA Sang-Heon Jeon
  2026-08-04 15:11 ` [PATCH v2 2/2] mm/page_ext: remove pgdat_page_ext_init() Sang-Heon Jeon
  0 siblings, 2 replies; 8+ messages in thread
From: Sang-Heon Jeon @ 2026-08-04 15:11 UTC (permalink / raw)
  To: Andrew Morton, David Hildenbrand, Mike Rapoport, Vlastimil Babka
  Cc: Brendan Jackman, Johannes Weiner, Liam R. Howlett, linux-kernel,
	linux-mm, Lorenzo Stoakes, Michal Hocko, Suren Baghdasaryan,
	Zi Yan

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/20260803134822.2568766-1-ekffu200098@gmail.com/ 
---

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(-)

-- 
2.43.0



^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH v2 1/2] mm/Kconfig: make FLATMEM depend on !NUMA
  2026-08-04 15:11 [PATCH v2 0/2] mm/page_ext: remove pgdat_page_ext_init() Sang-Heon Jeon
@ 2026-08-04 15:11 ` Sang-Heon Jeon
  2026-08-04 15:56   ` Zi Yan
                     ` (2 more replies)
  2026-08-04 15:11 ` [PATCH v2 2/2] mm/page_ext: remove pgdat_page_ext_init() Sang-Heon Jeon
  1 sibling, 3 replies; 8+ messages in thread
From: Sang-Heon Jeon @ 2026-08-04 15:11 UTC (permalink / raw)
  To: Andrew Morton, David Hildenbrand
  Cc: Liam R. Howlett, linux-kernel, linux-mm, Lorenzo Stoakes,
	Michal Hocko, Mike Rapoport, Suren Baghdasaryan, Vlastimil Babka,
	Zi Yan

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.

Suggested-by: Zi Yan <ziy@nvidia.com>
Signed-off-by: Sang-Heon Jeon <ekffu200098@gmail.com>
---
 mm/Kconfig | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/mm/Kconfig b/mm/Kconfig
index 060190e12bce..331daf7fcfab 100644
--- a/mm/Kconfig
+++ b/mm/Kconfig
@@ -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
 
 #
-- 
2.43.0



^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH v2 2/2] mm/page_ext: remove pgdat_page_ext_init()
  2026-08-04 15:11 [PATCH v2 0/2] mm/page_ext: remove pgdat_page_ext_init() Sang-Heon Jeon
  2026-08-04 15:11 ` [PATCH v2 1/2] mm/Kconfig: make FLATMEM depend on !NUMA Sang-Heon Jeon
@ 2026-08-04 15:11 ` Sang-Heon Jeon
  2026-08-04 15:57   ` Zi Yan
  2026-08-05 10:05   ` David Hildenbrand (Arm)
  1 sibling, 2 replies; 8+ messages in thread
From: Sang-Heon Jeon @ 2026-08-04 15:11 UTC (permalink / raw)
  To: Andrew Morton, David Hildenbrand, Mike Rapoport, Vlastimil Babka
  Cc: Brendan Jackman, Johannes Weiner, Liam R. Howlett, linux-kernel,
	linux-mm, Lorenzo Stoakes, Michal Hocko, Suren Baghdasaryan,
	Zi Yan

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.

Signed-off-by: Sang-Heon Jeon <ekffu200098@gmail.com>
---
 include/linux/page_ext.h | 5 -----
 mm/mm_init.c             | 1 -
 mm/page_ext.c            | 9 ---------
 3 files changed, 15 deletions(-)

diff --git a/include/linux/page_ext.h b/include/linux/page_ext.h
index f23d4b218da0..79c53ec45dfa 100644
--- a/include/linux/page_ext.h
+++ b/include/linux/page_ext.h
@@ -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)
 {
 }
diff --git a/mm/mm_init.c b/mm/mm_init.c
index 711f821f7b3c..e9c4204b73ad 100644
--- a/mm/mm_init.c
+++ b/mm/mm_init.c
@@ -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);
 }
 
diff --git a/mm/page_ext.c b/mm/page_ext.c
index e2e92bd27ebd..b679a8c1f7d7 100644
--- a/mm/page_ext.c
+++ b/mm/page_ext.c
@@ -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
 
 /**
-- 
2.43.0



^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH v2 1/2] mm/Kconfig: make FLATMEM depend on !NUMA
  2026-08-04 15:11 ` [PATCH v2 1/2] mm/Kconfig: make FLATMEM depend on !NUMA Sang-Heon Jeon
@ 2026-08-04 15:56   ` Zi Yan
  2026-08-05  9:46   ` Mike Rapoport
  2026-08-05 10:05   ` David Hildenbrand (Arm)
  2 siblings, 0 replies; 8+ messages in thread
From: Zi Yan @ 2026-08-04 15:56 UTC (permalink / raw)
  To: Sang-Heon Jeon, Andrew Morton, David Hildenbrand
  Cc: Liam R. Howlett, linux-kernel, linux-mm, Lorenzo Stoakes,
	Michal Hocko, Mike Rapoport, Suren Baghdasaryan, Vlastimil Babka

On Tue Aug 4, 2026 at 11:11 AM EDT, Sang-Heon Jeon wrote:
> 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.
>
> Suggested-by: Zi Yan <ziy@nvidia.com>
> Signed-off-by: Sang-Heon Jeon <ekffu200098@gmail.com>
> ---
>  mm/Kconfig | 2 ++
>  1 file changed, 2 insertions(+)

Hopefully no new arch will try to support it.

Acked-by: Zi Yan <ziy@nvidia.com>

>
> diff --git a/mm/Kconfig b/mm/Kconfig
> index 060190e12bce..331daf7fcfab 100644
> --- a/mm/Kconfig
> +++ b/mm/Kconfig
> @@ -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
>  
>  #




-- 
Best Regards,
Yan, Zi



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v2 2/2] mm/page_ext: remove pgdat_page_ext_init()
  2026-08-04 15:11 ` [PATCH v2 2/2] mm/page_ext: remove pgdat_page_ext_init() Sang-Heon Jeon
@ 2026-08-04 15:57   ` Zi Yan
  2026-08-05 10:05   ` David Hildenbrand (Arm)
  1 sibling, 0 replies; 8+ messages in thread
From: Zi Yan @ 2026-08-04 15:57 UTC (permalink / raw)
  To: Sang-Heon Jeon, Andrew Morton, David Hildenbrand, Mike Rapoport,
	Vlastimil Babka
  Cc: Brendan Jackman, Johannes Weiner, Liam R. Howlett, linux-kernel,
	linux-mm, Lorenzo Stoakes, Michal Hocko, Suren Baghdasaryan

On Tue Aug 4, 2026 at 11:11 AM EDT, Sang-Heon Jeon wrote:
> 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.
>
> Signed-off-by: Sang-Heon Jeon <ekffu200098@gmail.com>
> ---
>  include/linux/page_ext.h | 5 -----
>  mm/mm_init.c             | 1 -
>  mm/page_ext.c            | 9 ---------
>  3 files changed, 15 deletions(-)
>
LGTM.

Acked-by: Zi Yan <ziy@nvidia.com>

-- 
Best Regards,
Yan, Zi



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v2 1/2] mm/Kconfig: make FLATMEM depend on !NUMA
  2026-08-04 15:11 ` [PATCH v2 1/2] mm/Kconfig: make FLATMEM depend on !NUMA Sang-Heon Jeon
  2026-08-04 15:56   ` Zi Yan
@ 2026-08-05  9:46   ` Mike Rapoport
  2026-08-05 10:05   ` David Hildenbrand (Arm)
  2 siblings, 0 replies; 8+ messages in thread
From: Mike Rapoport @ 2026-08-05  9:46 UTC (permalink / raw)
  To: Sang-Heon Jeon
  Cc: Andrew Morton, David Hildenbrand, Liam R. Howlett, linux-kernel,
	linux-mm, Lorenzo Stoakes, Michal Hocko, Suren Baghdasaryan,
	Vlastimil Babka, Zi Yan

On Wed, Aug 05, 2026 at 12:11:41AM +0900, Sang-Heon Jeon wrote:
> 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.
> 
> Suggested-by: Zi Yan <ziy@nvidia.com>
> Signed-off-by: Sang-Heon Jeon <ekffu200098@gmail.com>

Acked-by: Mike Rapoport (Microsoft) <rppt@kernel.org>

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

-- 
Sincerely yours,
Mike.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v2 1/2] mm/Kconfig: make FLATMEM depend on !NUMA
  2026-08-04 15:11 ` [PATCH v2 1/2] mm/Kconfig: make FLATMEM depend on !NUMA Sang-Heon Jeon
  2026-08-04 15:56   ` Zi Yan
  2026-08-05  9:46   ` Mike Rapoport
@ 2026-08-05 10:05   ` David Hildenbrand (Arm)
  2 siblings, 0 replies; 8+ messages in thread
From: David Hildenbrand (Arm) @ 2026-08-05 10:05 UTC (permalink / raw)
  To: Sang-Heon Jeon, Andrew Morton
  Cc: Liam R. Howlett, linux-kernel, linux-mm, Lorenzo Stoakes,
	Michal Hocko, Mike Rapoport, Suren Baghdasaryan, Vlastimil Babka,
	Zi Yan

On 8/4/26 17:11, Sang-Heon Jeon wrote:
> 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.
> 
> Suggested-by: Zi Yan <ziy@nvidia.com>
> Signed-off-by: Sang-Heon Jeon <ekffu200098@gmail.com>
> ---

Is this survives the compile bots, perfect.

Acked-by: David Hildenbrand (Arm) <david@kernel.org>

-- 
Cheers,

David


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v2 2/2] mm/page_ext: remove pgdat_page_ext_init()
  2026-08-04 15:11 ` [PATCH v2 2/2] mm/page_ext: remove pgdat_page_ext_init() Sang-Heon Jeon
  2026-08-04 15:57   ` Zi Yan
@ 2026-08-05 10:05   ` David Hildenbrand (Arm)
  1 sibling, 0 replies; 8+ messages in thread
From: David Hildenbrand (Arm) @ 2026-08-05 10:05 UTC (permalink / raw)
  To: Sang-Heon Jeon, Andrew Morton, Mike Rapoport, Vlastimil Babka
  Cc: Brendan Jackman, Johannes Weiner, Liam R. Howlett, linux-kernel,
	linux-mm, Lorenzo Stoakes, Michal Hocko, Suren Baghdasaryan,
	Zi Yan

On 8/4/26 17:11, Sang-Heon Jeon wrote:
> 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.
> 
> Signed-off-by: Sang-Heon Jeon <ekffu200098@gmail.com>
> ---

Acked-by: David Hildenbrand (Arm) <david@kernel.org>

-- 
Cheers,

David


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2026-08-05 10:05 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-04 15:11 [PATCH v2 0/2] mm/page_ext: remove pgdat_page_ext_init() Sang-Heon Jeon
2026-08-04 15:11 ` [PATCH v2 1/2] mm/Kconfig: make FLATMEM depend on !NUMA Sang-Heon Jeon
2026-08-04 15:56   ` Zi Yan
2026-08-05  9:46   ` Mike Rapoport
2026-08-05 10:05   ` David Hildenbrand (Arm)
2026-08-04 15:11 ` [PATCH v2 2/2] mm/page_ext: remove pgdat_page_ext_init() Sang-Heon Jeon
2026-08-04 15:57   ` Zi Yan
2026-08-05 10:05   ` David Hildenbrand (Arm)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).