mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2 00/13] mm/sparse: remove SECTION_MARKED_PRESENT and further cleanups
@ 2026-09-21 19:58 David Hildenbrand (Arm)
  2026-09-21 19:58 ` [PATCH v2 01/13] mm/sparse: move mem_section init to sparse_extreme_init() David Hildenbrand (Arm)
                   ` (13 more replies)
  0 siblings, 14 replies; 16+ messages in thread
From: David Hildenbrand (Arm) @ 2026-09-21 19:58 UTC (permalink / raw)
  To: Andrew Morton, David Hildenbrand, Lorenzo Stoakes,
	Liam R. Howlett, Vlastimil Babka, Mike Rapoport,
	Suren Baghdasaryan, Michal Hocko, Kairui Song, Qi Zheng,
	Shakeel Butt, Barry Song, Axel Rasmussen, Yuanchu Xie, Wei Xu,
	Baoquan He, Baolin Wang, Brendan Jackman, Johannes Weiner,
	Zi Yan, Jan Kiszka, Kieran Bingham, Oscar Salvador,
	Greg Kroah-Hartman, Rafael J. Wysocki, Danilo Krummrich
  Cc: linux-kernel, linux-mm, linux-cxl, driver-core, linux-fsdevel,
	Seongjun Hong

SECTION_MARKED_PRESENT is really only needed during boot, where we
can instead just rely on SECTION_IS_EARLY_BIT by setting that flag
earlier.

Some preparations for doing that conversion and some cleanups in the same
(sparse) area.

Tested on x86 with and without memory hotplug through virtio-mem.

---
Changes in v2:
- Rebased to mm-unstable
- Add "scripts/gdb: mm.py: remove fallbacks for SECTION_HAS_MEM_MAP and
  SECTION_IS_EARLY"
- Improve comment in mmzone.h for __highest_used_section_nr
- Improve comment in fs/proc/page.c for get_max_dump_pfn()
- Move __highest_used_section_nr handling directly into
  __section_mark_present() callers and use max()
- Make pfn const in sparse_metadata_init_nid()
- Take care of .clang_format
- Smaller patch description fixes
- Link to v1: https://patch.msgid.link/20260909-b4-sparsemem_cleanups-v1-0-008fc8d579fe@kernel.org

To: Andrew Morton <akpm@linux-foundation.org>
To: David Hildenbrand <david@kernel.org>
To: Lorenzo Stoakes <ljs@kernel.org>
To: "Liam R. Howlett" <liam@infradead.org>
To: Vlastimil Babka <vbabka@kernel.org>
To: Mike Rapoport <rppt@kernel.org>
To: Suren Baghdasaryan <surenb@google.com>
To: Michal Hocko <mhocko@suse.com>
To: Kairui Song <kasong@tencent.com>
To: Qi Zheng <qi.zheng@linux.dev>
To: Shakeel Butt <shakeel.butt@linux.dev>
To: Barry Song <baohua@kernel.org>
To: Axel Rasmussen <axelrasmussen@google.com>
To: Yuanchu Xie <yuanchu@google.com>
To: Wei Xu <weixugc@google.com>
To: Baoquan He <baoquan.he@linux.dev>
To: Baolin Wang <baolin.wang@linux.alibaba.com>
To: Brendan Jackman <brendan.jackman@linux.dev>
To: Johannes Weiner <hannes@cmpxchg.org>
To: Zi Yan <ziy@nvidia.com>
To: Jan Kiszka <jan.kiszka@siemens.com>
To: Kieran Bingham <kbingham@kernel.org>
To: Oscar Salvador <osalvador@suse.de>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: "Rafael J. Wysocki" <rafael@kernel.org>
To: Danilo Krummrich <dakr@kernel.org>
Cc: linux-kernel@vger.kernel.org
Cc: linux-mm@kvack.org
Cc: linux-cxl@vger.kernel.org
Cc: driver-core@lists.linux.dev
Cc: linux-fsdevel@vger.kernel.org

---

David Hildenbrand (Arm) (13):
      mm/sparse: move mem_section init to sparse_extreme_init()
      mm/sparse: refactor sparse_sections_init()
      mm/sparse: move initialization of section metadata to sparse_metadata_init()
      mm/sparse: rename and cleanup sparse_init_nid()
      mm/sparse: cleanup sparse_init_one_section()
      mm/sparse: rename __highest_present_section_nr to __highest_used_section_nr
      mm/sparse: remove pfn_in_present_section()
      mm/sparse: move __highest_used_section_nr handling
      scripts/gdb: mm.py: remove fallbacks for SECTION_HAS_MEM_MAP and SECTION_IS_EARLY
      mm/sparse: remove SECTION_MARKED_PRESENT
      mm/sparse: remove flags parameter from sparse_init_one_section()
      fs/proc/page: clarify comment in get_max_dump_pfn()
      mm/memory_hotplug: drop CONFIG_HAVE_ARCH_PFN_VALID handling from pfn_to_online_page()

 .clang-format           |   2 +-
 drivers/base/memory.c   |   2 +-
 fs/proc/page.c          |   7 +--
 include/linux/cache.h   |   1 +
 include/linux/mmzone.h  |  43 ++++---------
 mm/compaction.c         |   2 +-
 mm/memory_hotplug.c     |   9 +--
 mm/sparse-vmemmap.c     |   4 +-
 mm/sparse.c             | 160 +++++++++++++++++++++++-------------------------
 mm/sparse.h             |  19 ++----
 scripts/gdb/linux/mm.py |   8 +--
 11 files changed, 108 insertions(+), 149 deletions(-)

---

base-commit: 8d61431ed2607386b427752505379536eb634ce8

change-id: 20260814-b4-sparsemem_cleanups-8bc4b47014c3

--

Cheers,

David


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

* [PATCH v2 01/13] mm/sparse: move mem_section init to sparse_extreme_init()
  2026-09-21 19:58 [PATCH v2 00/13] mm/sparse: remove SECTION_MARKED_PRESENT and further cleanups David Hildenbrand (Arm)
@ 2026-09-21 19:58 ` David Hildenbrand (Arm)
  2026-09-21 23:12   ` Zi Yan
  2026-09-21 19:58 ` [PATCH v2 02/13] mm/sparse: refactor sparse_sections_init() David Hildenbrand (Arm)
                   ` (12 subsequent siblings)
  13 siblings, 1 reply; 16+ messages in thread
From: David Hildenbrand (Arm) @ 2026-09-21 19:58 UTC (permalink / raw)
  To: Andrew Morton, David Hildenbrand, Lorenzo Stoakes,
	Liam R. Howlett, Vlastimil Babka, Mike Rapoport,
	Suren Baghdasaryan, Michal Hocko, Kairui Song, Qi Zheng,
	Shakeel Butt, Barry Song, Axel Rasmussen, Yuanchu Xie, Wei Xu,
	Baoquan He, Baolin Wang, Brendan Jackman, Johannes Weiner,
	Zi Yan, Jan Kiszka, Kieran Bingham, Oscar Salvador,
	Greg Kroah-Hartman, Rafael J. Wysocki, Danilo Krummrich
  Cc: linux-kernel, linux-mm, linux-cxl, driver-core, linux-fsdevel

Let's just avoid another pair of ifdef inside a function. While at it,
switch to INTERNODE_CACHE_BYTES by just defining a fallback in cache.h
as well, given that the x86 variant already provides one.

Acked-by: Oscar Salvador <osalvador@suse.de>
Reviewed-by: Lorenzo Stoakes (ARM) <ljs@kernel.org>
Reviewed-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
Signed-off-by: David Hildenbrand (Arm) <david@kernel.org>
---
 include/linux/cache.h |  1 +
 mm/sparse.c           | 19 ++++++++++++-------
 2 files changed, 13 insertions(+), 7 deletions(-)

diff --git a/include/linux/cache.h b/include/linux/cache.h
index e69768f50d532..b6e857b985bca 100644
--- a/include/linux/cache.h
+++ b/include/linux/cache.h
@@ -89,6 +89,7 @@
  */
 #ifndef INTERNODE_CACHE_SHIFT
 #define INTERNODE_CACHE_SHIFT L1_CACHE_SHIFT
+#define INTERNODE_CACHE_BYTES (1 << INTERNODE_CACHE_SHIFT)
 #endif
 
 #if !defined(____cacheline_internodealigned_in_smp)
diff --git a/mm/sparse.c b/mm/sparse.c
index b75921c622ede..8cd2b06b231ac 100644
--- a/mm/sparse.c
+++ b/mm/sparse.c
@@ -103,11 +103,22 @@ int __meminit sparse_index_init(unsigned long section_nr, int nid)
 
 	return 0;
 }
+
+static void __init sparse_extreme_init(void)
+{
+	const unsigned long size = sizeof(struct mem_section *) * NR_SECTION_ROOTS;
+
+	mem_section = memblock_alloc_or_panic(size, INTERNODE_CACHE_BYTES);
+}
 #else /* !SPARSEMEM_EXTREME */
 int __meminit sparse_index_init(unsigned long section_nr, int nid)
 {
 	return 0;
 }
+
+static void __init sparse_extreme_init(void)
+{
+}
 #endif
 
 /*
@@ -196,13 +207,7 @@ void __init sparse_sections_init(void)
 	unsigned long start, end;
 	int i, nid;
 
-#ifdef CONFIG_SPARSEMEM_EXTREME
-	unsigned long size, align;
-
-	size = sizeof(struct mem_section *) * NR_SECTION_ROOTS;
-	align = 1 << (INTERNODE_CACHE_SHIFT);
-	mem_section = memblock_alloc_or_panic(size, align);
-#endif
+	sparse_extreme_init();
 
 	for_each_mem_pfn_range(i, MAX_NUMNODES, &start, &end, &nid)
 		memory_present(nid, start, end);

-- 
2.43.0


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

* [PATCH v2 02/13] mm/sparse: refactor sparse_sections_init()
  2026-09-21 19:58 [PATCH v2 00/13] mm/sparse: remove SECTION_MARKED_PRESENT and further cleanups David Hildenbrand (Arm)
  2026-09-21 19:58 ` [PATCH v2 01/13] mm/sparse: move mem_section init to sparse_extreme_init() David Hildenbrand (Arm)
@ 2026-09-21 19:58 ` David Hildenbrand (Arm)
  2026-09-21 19:58 ` [PATCH v2 03/13] mm/sparse: move initialization of section metadata to sparse_metadata_init() David Hildenbrand (Arm)
                   ` (11 subsequent siblings)
  13 siblings, 0 replies; 16+ messages in thread
From: David Hildenbrand (Arm) @ 2026-09-21 19:58 UTC (permalink / raw)
  To: Andrew Morton, David Hildenbrand, Lorenzo Stoakes,
	Liam R. Howlett, Vlastimil Babka, Mike Rapoport,
	Suren Baghdasaryan, Michal Hocko, Kairui Song, Qi Zheng,
	Shakeel Butt, Barry Song, Axel Rasmussen, Yuanchu Xie, Wei Xu,
	Baoquan He, Baolin Wang, Brendan Jackman, Johannes Weiner,
	Zi Yan, Jan Kiszka, Kieran Bingham, Oscar Salvador,
	Greg Kroah-Hartman, Rafael J. Wysocki, Danilo Krummrich
  Cc: linux-kernel, linux-mm, linux-cxl, driver-core, linux-fsdevel

memory_present() really identifies+prepares all early sections so the
initialization in sparse_init() can properly iterating them to
initialize metadata.

Let's just inline memory_present() into sparse_sections_init() and
cleaning up the code a bit while at it: make it clear that we are operating
on pfns.

Note that we call set_section_nid() now only if the section
was not already created earlier. Now, there is no more inconsistency
between what we (temporarily) store in ms->section_mem_map and what
we store in our section->nid array.

Acked-by: Oscar Salvador <osalvador@suse.de>
Acked-by: Lorenzo Stoakes (ARM) <ljs@kernel.org>
Reviewed-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
Signed-off-by: David Hildenbrand (Arm) <david@kernel.org>
---
 mm/sparse.c | 41 +++++++++++++++++------------------------
 1 file changed, 17 insertions(+), 24 deletions(-)

diff --git a/mm/sparse.c b/mm/sparse.c
index 8cd2b06b231ac..2b285653abf1e 100644
--- a/mm/sparse.c
+++ b/mm/sparse.c
@@ -179,40 +179,33 @@ static inline unsigned long first_present_section_nr(void)
 	return next_present_section_nr(-1);
 }
 
-/* Record a memory area against a node. */
-static void __init memory_present(int nid, unsigned long start, unsigned long end)
+void __init sparse_sections_init(void)
 {
-	unsigned long pfn;
+	unsigned long pfn, start_pfn, end_pfn;
+	int i, nid;
+
+	sparse_extreme_init();
 
-	start &= PAGE_SECTION_MASK;
-	mminit_validate_memmodel_limits(&start, &end);
-	for (pfn = start; pfn < end; pfn += PAGES_PER_SECTION) {
-		unsigned long section_nr = pfn_to_section_nr(pfn);
-		struct mem_section *ms;
+	for_each_mem_pfn_range(i, MAX_NUMNODES, &start_pfn, &end_pfn, &nid) {
+		start_pfn &= PAGE_SECTION_MASK;
+		mminit_validate_memmodel_limits(&start_pfn, &end_pfn);
 
-		sparse_index_init(section_nr, nid);
-		set_section_nid(section_nr, nid);
+		for (pfn = start_pfn; pfn < end_pfn; pfn += PAGES_PER_SECTION) {
+			unsigned long section_nr = pfn_to_section_nr(pfn);
+			struct mem_section *ms;
 
-		ms = __nr_to_section(section_nr);
-		if (!ms->section_mem_map) {
+			sparse_index_init(section_nr, nid);
+			ms = __nr_to_section(section_nr);
+			if (ms->section_mem_map)
+				continue;
+
+			set_section_nid(section_nr, nid);
 			ms->section_mem_map = sparse_encode_early_nid(nid) |
 							SECTION_IS_ONLINE;
 			__section_mark_present(ms, section_nr);
 		}
 	}
 }
-
-void __init sparse_sections_init(void)
-{
-	unsigned long start, end;
-	int i, nid;
-
-	sparse_extreme_init();
-
-	for_each_mem_pfn_range(i, MAX_NUMNODES, &start, &end, &nid)
-		memory_present(nid, start, end);
-}
-
 #ifndef CONFIG_SPARSEMEM_VMEMMAP
 struct page __init *__populate_section_memmap(unsigned long pfn,
 		unsigned long nr_pages, int nid, struct vmem_altmap *altmap,

-- 
2.43.0


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

* [PATCH v2 03/13] mm/sparse: move initialization of section metadata to sparse_metadata_init()
  2026-09-21 19:58 [PATCH v2 00/13] mm/sparse: remove SECTION_MARKED_PRESENT and further cleanups David Hildenbrand (Arm)
  2026-09-21 19:58 ` [PATCH v2 01/13] mm/sparse: move mem_section init to sparse_extreme_init() David Hildenbrand (Arm)
  2026-09-21 19:58 ` [PATCH v2 02/13] mm/sparse: refactor sparse_sections_init() David Hildenbrand (Arm)
@ 2026-09-21 19:58 ` David Hildenbrand (Arm)
  2026-09-21 19:58 ` [PATCH v2 04/13] mm/sparse: rename and cleanup sparse_init_nid() David Hildenbrand (Arm)
                   ` (10 subsequent siblings)
  13 siblings, 0 replies; 16+ messages in thread
From: David Hildenbrand (Arm) @ 2026-09-21 19:58 UTC (permalink / raw)
  To: Andrew Morton, David Hildenbrand, Lorenzo Stoakes,
	Liam R. Howlett, Vlastimil Babka, Mike Rapoport,
	Suren Baghdasaryan, Michal Hocko, Kairui Song, Qi Zheng,
	Shakeel Butt, Barry Song, Axel Rasmussen, Yuanchu Xie, Wei Xu,
	Baoquan He, Baolin Wang, Brendan Jackman, Johannes Weiner,
	Zi Yan, Jan Kiszka, Kieran Bingham, Oscar Salvador,
	Greg Kroah-Hartman, Rafael J. Wysocki, Danilo Krummrich
  Cc: linux-kernel, linux-mm, linux-cxl, driver-core, linux-fsdevel

Let's move the code responsible for initializing sparse metadata (usemap,
memmap) into a helper. Cleanup the variable while at it (e.g.,
"map_count").

Drop the rather obvious code comments.

No functional change intended.

Acked-by: Oscar Salvador <osalvador@suse.de>
Reviewed-by: Lorenzo Stoakes (ARM) <ljs@kernel.org>
Reviewed-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
Signed-off-by: David Hildenbrand (Arm) <david@kernel.org>
---
 mm/sparse.c | 43 ++++++++++++++++++++++---------------------
 1 file changed, 22 insertions(+), 21 deletions(-)

diff --git a/mm/sparse.c b/mm/sparse.c
index 2b285653abf1e..71288daeb3665 100644
--- a/mm/sparse.c
+++ b/mm/sparse.c
@@ -255,38 +255,39 @@ static void __init sparse_init_nid(int nid, unsigned long pnum_begin,
 	}
 }
 
+static void __init sparse_metadata_init(void)
+{
+	unsigned long start_section_nr = first_present_section_nr();
+	int nid_begin = sparse_early_nid(__nr_to_section(start_section_nr));
+	unsigned long section_nr, nr_sections = 1;
+
+	for_each_present_section_nr(start_section_nr + 1, section_nr) {
+		const int nid = sparse_early_nid(__nr_to_section(section_nr));
+
+		if (nid == nid_begin) {
+			nr_sections++;
+			continue;
+		}
+		sparse_init_nid(nid_begin, start_section_nr, section_nr, nr_sections);
+		nid_begin = nid;
+		start_section_nr = section_nr;
+		nr_sections = 1;
+	}
+	sparse_init_nid(nid_begin, start_section_nr, section_nr, nr_sections);
+}
+
 /*
  * Allocate the accumulated non-linear sections, allocate a mem_map
  * for each and record the physical to section mapping.
  */
 void __init sparse_init(void)
 {
-	unsigned long pnum_end, pnum_begin, map_count = 1;
-	int nid_begin;
-
 	if (compound_info_has_mask()) {
 		VM_WARN_ON_ONCE(!IS_ALIGNED((unsigned long) pfn_to_page(0),
 				    MAX_FOLIO_VMEMMAP_ALIGN));
 	}
 
-	pnum_begin = first_present_section_nr();
-	nid_begin = sparse_early_nid(__nr_to_section(pnum_begin));
-
-	for_each_present_section_nr(pnum_begin + 1, pnum_end) {
-		int nid = sparse_early_nid(__nr_to_section(pnum_end));
-
-		if (nid == nid_begin) {
-			map_count++;
-			continue;
-		}
-		/* Init node with sections in range [pnum_begin, pnum_end) */
-		sparse_init_nid(nid_begin, pnum_begin, pnum_end, map_count);
-		nid_begin = nid;
-		pnum_begin = pnum_end;
-		map_count = 1;
-	}
-	/* cover the last node */
-	sparse_init_nid(nid_begin, pnum_begin, pnum_end, map_count);
+	sparse_metadata_init();
 	sparse_init_subsection_map();
 	vmemmap_populate_print_last();
 }

-- 
2.43.0


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

* [PATCH v2 04/13] mm/sparse: rename and cleanup sparse_init_nid()
  2026-09-21 19:58 [PATCH v2 00/13] mm/sparse: remove SECTION_MARKED_PRESENT and further cleanups David Hildenbrand (Arm)
                   ` (2 preceding siblings ...)
  2026-09-21 19:58 ` [PATCH v2 03/13] mm/sparse: move initialization of section metadata to sparse_metadata_init() David Hildenbrand (Arm)
@ 2026-09-21 19:58 ` David Hildenbrand (Arm)
  2026-09-21 19:58 ` [PATCH v2 05/13] mm/sparse: cleanup sparse_init_one_section() David Hildenbrand (Arm)
                   ` (9 subsequent siblings)
  13 siblings, 0 replies; 16+ messages in thread
From: David Hildenbrand (Arm) @ 2026-09-21 19:58 UTC (permalink / raw)
  To: Andrew Morton, David Hildenbrand, Lorenzo Stoakes,
	Liam R. Howlett, Vlastimil Babka, Mike Rapoport,
	Suren Baghdasaryan, Michal Hocko, Kairui Song, Qi Zheng,
	Shakeel Butt, Barry Song, Axel Rasmussen, Yuanchu Xie, Wei Xu,
	Baoquan He, Baolin Wang, Brendan Jackman, Johannes Weiner,
	Zi Yan, Jan Kiszka, Kieran Bingham, Oscar Salvador,
	Greg Kroah-Hartman, Rafael J. Wysocki, Danilo Krummrich
  Cc: linux-kernel, linux-mm, linux-cxl, driver-core, linux-fsdevel

Let's rename it to "sparse_metadata_init_nid", avoid the "pnum" terminology
and drop the function comment. Further, rename the "map" variable to
"mem_map" for consistency with other functions.

Acked-by: Oscar Salvador <osalvador@suse.de>
Reviewed-by: Lorenzo Stoakes (ARM) <ljs@kernel.org>
Reviewed-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
Signed-off-by: David Hildenbrand (Arm) <david@kernel.org>
---
 mm/sparse.c | 41 ++++++++++++++++++++---------------------
 1 file changed, 20 insertions(+), 21 deletions(-)

diff --git a/mm/sparse.c b/mm/sparse.c
index 71288daeb3665..3c19d47559090 100644
--- a/mm/sparse.c
+++ b/mm/sparse.c
@@ -221,36 +221,33 @@ void __weak __meminit vmemmap_populate_print_last(void)
 {
 }
 
-/*
- * Initialize sparse on a specific node. The node spans [pnum_begin, pnum_end)
- * And number of present sections in this node is map_count.
- */
-static void __init sparse_init_nid(int nid, unsigned long pnum_begin,
-				   unsigned long pnum_end,
-				   unsigned long map_count)
+static void __init sparse_metadata_init_nid(int nid,
+		unsigned long start_section_nr, unsigned long end_section_nr,
+		unsigned long nr_sections)
 {
-	unsigned long pnum;
 	struct mem_section_usage *usage;
+	unsigned long section_nr;
 
-	usage = memblock_alloc_node(map_count * mem_section_usage_size(),
+	usage = memblock_alloc_node(nr_sections * mem_section_usage_size(),
 				    SMP_CACHE_BYTES, nid);
 	if (!usage)
 		panic("Failed to allocate usemap for node %d\n", nid);
 
-	for_each_present_section_nr(pnum_begin, pnum) {
-		unsigned long pfn = section_nr_to_pfn(pnum);
-		struct page *map;
+	for_each_present_section_nr(start_section_nr, section_nr) {
+		const unsigned long pfn = section_nr_to_pfn(section_nr);
+		struct page *mem_map;
 
-		if (pnum >= pnum_end)
+		if (section_nr >= end_section_nr)
 			break;
 
-		map = __populate_section_memmap(pfn, PAGES_PER_SECTION,
-						nid, NULL, NULL);
-		if (!map)
-			panic("Failed to allocate memmap for section %lu\n", pnum);
+		mem_map = __populate_section_memmap(pfn, PAGES_PER_SECTION, nid,
+						    NULL, NULL);
+		if (!mem_map)
+			panic("Failed to allocate memmap for section %lu\n",
+			      section_nr);
 		memmap_boot_pages_add(section_nr_vmemmap_pages(pfn, PAGES_PER_SECTION));
-		sparse_init_one_section(__nr_to_section(pnum), pnum, map, usage,
-					SECTION_IS_EARLY);
+		sparse_init_one_section(__nr_to_section(section_nr), section_nr,
+					mem_map, usage, SECTION_IS_EARLY);
 		usage = (void *)usage + mem_section_usage_size();
 	}
 }
@@ -268,12 +265,14 @@ static void __init sparse_metadata_init(void)
 			nr_sections++;
 			continue;
 		}
-		sparse_init_nid(nid_begin, start_section_nr, section_nr, nr_sections);
+		sparse_metadata_init_nid(nid_begin, start_section_nr,
+					 section_nr, nr_sections);
 		nid_begin = nid;
 		start_section_nr = section_nr;
 		nr_sections = 1;
 	}
-	sparse_init_nid(nid_begin, start_section_nr, section_nr, nr_sections);
+	sparse_metadata_init_nid(nid_begin, start_section_nr, section_nr,
+				 nr_sections);
 }
 
 /*

-- 
2.43.0


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

* [PATCH v2 05/13] mm/sparse: cleanup sparse_init_one_section()
  2026-09-21 19:58 [PATCH v2 00/13] mm/sparse: remove SECTION_MARKED_PRESENT and further cleanups David Hildenbrand (Arm)
                   ` (3 preceding siblings ...)
  2026-09-21 19:58 ` [PATCH v2 04/13] mm/sparse: rename and cleanup sparse_init_nid() David Hildenbrand (Arm)
@ 2026-09-21 19:58 ` David Hildenbrand (Arm)
  2026-09-21 19:58 ` [PATCH v2 06/13] mm/sparse: rename __highest_present_section_nr to __highest_used_section_nr David Hildenbrand (Arm)
                   ` (8 subsequent siblings)
  13 siblings, 0 replies; 16+ messages in thread
From: David Hildenbrand (Arm) @ 2026-09-21 19:58 UTC (permalink / raw)
  To: Andrew Morton, David Hildenbrand, Lorenzo Stoakes,
	Liam R. Howlett, Vlastimil Babka, Mike Rapoport,
	Suren Baghdasaryan, Michal Hocko, Kairui Song, Qi Zheng,
	Shakeel Butt, Barry Song, Axel Rasmussen, Yuanchu Xie, Wei Xu,
	Baoquan He, Baolin Wang, Brendan Jackman, Johannes Weiner,
	Zi Yan, Jan Kiszka, Kieran Bingham, Oscar Salvador,
	Greg Kroah-Hartman, Rafael J. Wysocki, Danilo Krummrich
  Cc: linux-kernel, linux-mm, linux-cxl, driver-core, linux-fsdevel

Let's avoid the "pnum" terminology.

Acked-by: Oscar Salvador <osalvador@suse.de>
Reviewed-by: Lorenzo Stoakes (ARM) <ljs@kernel.org>
Reviewed-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
Signed-off-by: David Hildenbrand (Arm) <david@kernel.org>
---
 mm/sparse.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/mm/sparse.h b/mm/sparse.h
index 530692cdd516f..4ee507c34b98d 100644
--- a/mm/sparse.h
+++ b/mm/sparse.h
@@ -20,7 +20,7 @@ void sparse_sections_init(void);
 int sparse_index_init(unsigned long section_nr, int nid);
 
 static inline void sparse_init_one_section(struct mem_section *ms,
-		unsigned long pnum, struct page *mem_map,
+		unsigned long section_nr, struct page *mem_map,
 		struct mem_section_usage *usage, unsigned long flags)
 {
 	unsigned long coded_mem_map;
@@ -32,7 +32,7 @@ static inline void sparse_init_one_section(struct mem_section *ms,
 	 * page_to_pfn() on !CONFIG_SPARSEMEM_VMEMMAP can simply subtract it
 	 * from the page pointer to obtain the PFN.
 	 */
-	coded_mem_map = (unsigned long)(mem_map - section_nr_to_pfn(pnum));
+	coded_mem_map = (unsigned long)(mem_map - section_nr_to_pfn(section_nr));
 	VM_WARN_ON_ONCE(coded_mem_map & ~SECTION_MAP_MASK);
 
 	ms->section_mem_map &= ~SECTION_MAP_MASK;

-- 
2.43.0


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

* [PATCH v2 06/13] mm/sparse: rename __highest_present_section_nr to __highest_used_section_nr
  2026-09-21 19:58 [PATCH v2 00/13] mm/sparse: remove SECTION_MARKED_PRESENT and further cleanups David Hildenbrand (Arm)
                   ` (4 preceding siblings ...)
  2026-09-21 19:58 ` [PATCH v2 05/13] mm/sparse: cleanup sparse_init_one_section() David Hildenbrand (Arm)
@ 2026-09-21 19:58 ` David Hildenbrand (Arm)
  2026-09-21 19:58 ` [PATCH v2 07/13] mm/sparse: remove pfn_in_present_section() David Hildenbrand (Arm)
                   ` (7 subsequent siblings)
  13 siblings, 0 replies; 16+ messages in thread
From: David Hildenbrand (Arm) @ 2026-09-21 19:58 UTC (permalink / raw)
  To: Andrew Morton, David Hildenbrand, Lorenzo Stoakes,
	Liam R. Howlett, Vlastimil Babka, Mike Rapoport,
	Suren Baghdasaryan, Michal Hocko, Kairui Song, Qi Zheng,
	Shakeel Butt, Barry Song, Axel Rasmussen, Yuanchu Xie, Wei Xu,
	Baoquan He, Baolin Wang, Brendan Jackman, Johannes Weiner,
	Zi Yan, Jan Kiszka, Kieran Bingham, Oscar Salvador,
	Greg Kroah-Hartman, Rafael J. Wysocki, Danilo Krummrich
  Cc: linux-kernel, linux-mm, linux-cxl, driver-core, linux-fsdevel

In preparation for getting rid of SECTION_MARKED_PRESENT, rename
__highest_present_section_nr and clarify the comment.

Acked-by: Oscar Salvador <osalvador@suse.de>
Reviewed-by: Lorenzo Stoakes (ARM) <ljs@kernel.org>
Reviewed-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
Signed-off-by: David Hildenbrand (Arm) <david@kernel.org>
---
 include/linux/mmzone.h |  6 +++---
 mm/compaction.c        |  2 +-
 mm/sparse.c            | 12 ++++--------
 mm/sparse.h            |  4 ++--
 4 files changed, 10 insertions(+), 14 deletions(-)

diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
index ebbda6f311392..0c2fea48c261b 100644
--- a/include/linux/mmzone.h
+++ b/include/linux/mmzone.h
@@ -2181,7 +2181,7 @@ static inline struct mem_section *__pfn_to_section(unsigned long pfn)
 	return __nr_to_section(pfn_to_section_nr(pfn));
 }
 
-extern unsigned long __highest_present_section_nr;
+extern unsigned long __highest_used_section_nr;
 
 static inline int subsection_map_index(unsigned long pfn)
 {
@@ -2280,7 +2280,7 @@ static inline unsigned long first_valid_pfn(unsigned long pfn, unsigned long end
 
 	rcu_read_lock_sched();
 
-	while (nr <= __highest_present_section_nr && pfn < end_pfn) {
+	while (nr <= __highest_used_section_nr && pfn < end_pfn) {
 		struct mem_section *ms = __pfn_to_section(pfn);
 
 		if (valid_section(ms) &&
@@ -2335,7 +2335,7 @@ static inline int pfn_in_present_section(unsigned long pfn)
 
 static inline unsigned long next_present_section_nr(unsigned long section_nr)
 {
-	while (++section_nr <= __highest_present_section_nr) {
+	while (++section_nr <= __highest_used_section_nr) {
 		if (present_section_nr(section_nr))
 			return section_nr;
 	}
diff --git a/mm/compaction.c b/mm/compaction.c
index 4994e200bbecd..f1b2060eb2016 100644
--- a/mm/compaction.c
+++ b/mm/compaction.c
@@ -216,7 +216,7 @@ static unsigned long skip_offline_sections(unsigned long start_pfn)
 	if (online_section_nr(start_nr))
 		return 0;
 
-	while (++start_nr <= __highest_present_section_nr) {
+	while (++start_nr <= __highest_used_section_nr) {
 		if (online_section_nr(start_nr))
 			return section_nr_to_pfn(start_nr);
 	}
diff --git a/mm/sparse.c b/mm/sparse.c
index 3c19d47559090..bb89017254f4d 100644
--- a/mm/sparse.c
+++ b/mm/sparse.c
@@ -164,15 +164,11 @@ static void __init mminit_validate_memmodel_limits(unsigned long *start_pfn,
 }
 
 /*
- * There are a number of times that we loop over NR_MEM_SECTIONS,
- * looking for section_present() on each.  But, when we have very
- * large physical address spaces, NR_MEM_SECTIONS can also be
- * very large which makes the loops quite long.
- *
- * Keeping track of this gives us an easy way to break out of
- * those loops early.
+ * Looping over all possible memory sections is expensive, especially if
+ * NR_MEM_SECTIONS is large but only a fraction is actually used. Keep track of
+ * the highest section number we ever used.
  */
-unsigned long __highest_present_section_nr;
+unsigned long __highest_used_section_nr;
 
 static inline unsigned long first_present_section_nr(void)
 {
diff --git a/mm/sparse.h b/mm/sparse.h
index 4ee507c34b98d..242b7bab0013c 100644
--- a/mm/sparse.h
+++ b/mm/sparse.h
@@ -44,8 +44,8 @@ static inline void sparse_init_one_section(struct mem_section *ms,
 static inline void __section_mark_present(struct mem_section *ms,
 		unsigned long section_nr)
 {
-	if (section_nr > __highest_present_section_nr)
-		__highest_present_section_nr = section_nr;
+	if (section_nr > __highest_used_section_nr)
+		__highest_used_section_nr = section_nr;
 
 	ms->section_mem_map |= SECTION_MARKED_PRESENT;
 }

-- 
2.43.0


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

* [PATCH v2 07/13] mm/sparse: remove pfn_in_present_section()
  2026-09-21 19:58 [PATCH v2 00/13] mm/sparse: remove SECTION_MARKED_PRESENT and further cleanups David Hildenbrand (Arm)
                   ` (5 preceding siblings ...)
  2026-09-21 19:58 ` [PATCH v2 06/13] mm/sparse: rename __highest_present_section_nr to __highest_used_section_nr David Hildenbrand (Arm)
@ 2026-09-21 19:58 ` David Hildenbrand (Arm)
  2026-09-21 19:59 ` [PATCH v2 08/13] mm/sparse: move __highest_used_section_nr handling David Hildenbrand (Arm)
                   ` (6 subsequent siblings)
  13 siblings, 0 replies; 16+ messages in thread
From: David Hildenbrand (Arm) @ 2026-09-21 19:58 UTC (permalink / raw)
  To: Andrew Morton, David Hildenbrand, Lorenzo Stoakes,
	Liam R. Howlett, Vlastimil Babka, Mike Rapoport,
	Suren Baghdasaryan, Michal Hocko, Kairui Song, Qi Zheng,
	Shakeel Butt, Barry Song, Axel Rasmussen, Yuanchu Xie, Wei Xu,
	Baoquan He, Baolin Wang, Brendan Jackman, Johannes Weiner,
	Zi Yan, Jan Kiszka, Kieran Bingham, Oscar Salvador,
	Greg Kroah-Hartman, Rafael J. Wysocki, Danilo Krummrich
  Cc: linux-kernel, linux-mm, linux-cxl, driver-core, linux-fsdevel

Unused, let's remove it.

Acked-by: Oscar Salvador <osalvador@suse.de>
Reviewed-by: Lorenzo Stoakes (ARM) <ljs@kernel.org>
Reviewed-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
Signed-off-by: David Hildenbrand (Arm) <david@kernel.org>
---
 include/linux/mmzone.h | 10 ----------
 1 file changed, 10 deletions(-)

diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
index 0c2fea48c261b..a3937577fbfb2 100644
--- a/include/linux/mmzone.h
+++ b/include/linux/mmzone.h
@@ -2326,13 +2326,6 @@ static inline unsigned long next_valid_pfn(unsigned long pfn, unsigned long end_
 
 #endif
 
-static inline int pfn_in_present_section(unsigned long pfn)
-{
-	if (pfn_to_section_nr(pfn) >= NR_MEM_SECTIONS)
-		return 0;
-	return present_section(__pfn_to_section(pfn));
-}
-
 static inline unsigned long next_present_section_nr(unsigned long section_nr)
 {
 	while (++section_nr <= __highest_used_section_nr) {
@@ -2362,9 +2355,6 @@ static inline unsigned long next_present_section_nr(unsigned long section_nr)
 #else
 #define pfn_to_nid(pfn)		(0)
 #endif
-
-#else
-#define pfn_in_present_section pfn_valid
 #endif /* CONFIG_SPARSEMEM */
 
 /*

-- 
2.43.0


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

* [PATCH v2 08/13] mm/sparse: move __highest_used_section_nr handling
  2026-09-21 19:58 [PATCH v2 00/13] mm/sparse: remove SECTION_MARKED_PRESENT and further cleanups David Hildenbrand (Arm)
                   ` (6 preceding siblings ...)
  2026-09-21 19:58 ` [PATCH v2 07/13] mm/sparse: remove pfn_in_present_section() David Hildenbrand (Arm)
@ 2026-09-21 19:59 ` David Hildenbrand (Arm)
  2026-09-21 19:59 ` [PATCH v2 09/13] scripts/gdb: mm.py: remove fallbacks for SECTION_HAS_MEM_MAP and SECTION_IS_EARLY David Hildenbrand (Arm)
                   ` (5 subsequent siblings)
  13 siblings, 0 replies; 16+ messages in thread
From: David Hildenbrand (Arm) @ 2026-09-21 19:59 UTC (permalink / raw)
  To: Andrew Morton, David Hildenbrand, Lorenzo Stoakes,
	Liam R. Howlett, Vlastimil Babka, Mike Rapoport,
	Suren Baghdasaryan, Michal Hocko, Kairui Song, Qi Zheng,
	Shakeel Butt, Barry Song, Axel Rasmussen, Yuanchu Xie, Wei Xu,
	Baoquan He, Baolin Wang, Brendan Jackman, Johannes Weiner,
	Zi Yan, Jan Kiszka, Kieran Bingham, Oscar Salvador,
	Greg Kroah-Hartman, Rafael J. Wysocki, Danilo Krummrich
  Cc: linux-kernel, linux-mm, linux-cxl, driver-core, linux-fsdevel

In preparation for removing __section_mark_present(), let's move
__highest_used_section_nr handling into its callers. Verify in
sparse_init_one_section() that it was properly updated.

In sparse_sections_init() we can just set it to the last processed
section_nr.

No functional change intended.

Reviewed-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
Signed-off-by: David Hildenbrand (Arm) <david@kernel.org>
---
 mm/sparse-vmemmap.c | 1 +
 mm/sparse.c         | 5 +++--
 mm/sparse.h         | 4 +---
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/mm/sparse-vmemmap.c b/mm/sparse-vmemmap.c
index 96506f594924c..e89efb67e8e6d 100644
--- a/mm/sparse-vmemmap.c
+++ b/mm/sparse-vmemmap.c
@@ -865,6 +865,7 @@ int __meminit sparse_add_section(int nid, unsigned long start_pfn,
 		page_init_poison(memmap, sizeof(struct page) * nr_pages);
 
 	__section_mark_present(ms, section_nr);
+	__highest_used_section_nr = max(section_nr, __highest_used_section_nr);
 
 	/* Align memmap to section boundary in the subsection case */
 	if (section_nr_to_pfn(section_nr) != start_pfn)
diff --git a/mm/sparse.c b/mm/sparse.c
index bb89017254f4d..a0f50ca5acf5a 100644
--- a/mm/sparse.c
+++ b/mm/sparse.c
@@ -177,7 +177,7 @@ static inline unsigned long first_present_section_nr(void)
 
 void __init sparse_sections_init(void)
 {
-	unsigned long pfn, start_pfn, end_pfn;
+	unsigned long pfn, start_pfn, end_pfn, section_nr;
 	int i, nid;
 
 	sparse_extreme_init();
@@ -187,9 +187,9 @@ void __init sparse_sections_init(void)
 		mminit_validate_memmodel_limits(&start_pfn, &end_pfn);
 
 		for (pfn = start_pfn; pfn < end_pfn; pfn += PAGES_PER_SECTION) {
-			unsigned long section_nr = pfn_to_section_nr(pfn);
 			struct mem_section *ms;
 
+			section_nr = pfn_to_section_nr(pfn);
 			sparse_index_init(section_nr, nid);
 			ms = __nr_to_section(section_nr);
 			if (ms->section_mem_map)
@@ -201,6 +201,7 @@ void __init sparse_sections_init(void)
 			__section_mark_present(ms, section_nr);
 		}
 	}
+	__highest_used_section_nr = section_nr;
 }
 #ifndef CONFIG_SPARSEMEM_VMEMMAP
 struct page __init *__populate_section_memmap(unsigned long pfn,
diff --git a/mm/sparse.h b/mm/sparse.h
index 242b7bab0013c..c396d5c05cfc8 100644
--- a/mm/sparse.h
+++ b/mm/sparse.h
@@ -26,6 +26,7 @@ static inline void sparse_init_one_section(struct mem_section *ms,
 	unsigned long coded_mem_map;
 
 	BUILD_BUG_ON(SECTION_MAP_LAST_BIT > PFN_SECTION_SHIFT);
+	VM_WARN_ON_ONCE(section_nr > __highest_used_section_nr);
 
 	/*
 	 * We encode the start PFN of the section into the mem_map such that
@@ -44,9 +45,6 @@ static inline void sparse_init_one_section(struct mem_section *ms,
 static inline void __section_mark_present(struct mem_section *ms,
 		unsigned long section_nr)
 {
-	if (section_nr > __highest_used_section_nr)
-		__highest_used_section_nr = section_nr;
-
 	ms->section_mem_map |= SECTION_MARKED_PRESENT;
 }
 

-- 
2.43.0


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

* [PATCH v2 09/13] scripts/gdb: mm.py: remove fallbacks for SECTION_HAS_MEM_MAP and SECTION_IS_EARLY
  2026-09-21 19:58 [PATCH v2 00/13] mm/sparse: remove SECTION_MARKED_PRESENT and further cleanups David Hildenbrand (Arm)
                   ` (7 preceding siblings ...)
  2026-09-21 19:59 ` [PATCH v2 08/13] mm/sparse: move __highest_used_section_nr handling David Hildenbrand (Arm)
@ 2026-09-21 19:59 ` David Hildenbrand (Arm)
  2026-09-21 19:59 ` [PATCH v2 10/13] mm/sparse: remove SECTION_MARKED_PRESENT David Hildenbrand (Arm)
                   ` (4 subsequent siblings)
  13 siblings, 0 replies; 16+ messages in thread
From: David Hildenbrand (Arm) @ 2026-09-21 19:59 UTC (permalink / raw)
  To: Andrew Morton, David Hildenbrand, Lorenzo Stoakes,
	Liam R. Howlett, Vlastimil Babka, Mike Rapoport,
	Suren Baghdasaryan, Michal Hocko, Kairui Song, Qi Zheng,
	Shakeel Butt, Barry Song, Axel Rasmussen, Yuanchu Xie, Wei Xu,
	Baoquan He, Baolin Wang, Brendan Jackman, Johannes Weiner,
	Zi Yan, Jan Kiszka, Kieran Bingham, Oscar Salvador,
	Greg Kroah-Hartman, Rafael J. Wysocki, Danilo Krummrich
  Cc: linux-kernel, linux-mm, linux-cxl, driver-core, linux-fsdevel,
	Seongjun Hong

There is no reason to handle the absence of the corresponding BIT
values. So let's remove the fallbacks.

Link: https://lore.kernel.org/r/vpz5zqg5nwbpolxbkip45vxxdt3lni7j2haal7q42skc3b57tu@uh4cec4x32dq
Cc: Seongjun Hong <hsj0512@snu.ac.kr>
Signed-off-by: David Hildenbrand (Arm) <david@kernel.org>
---
 scripts/gdb/linux/mm.py | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/scripts/gdb/linux/mm.py b/scripts/gdb/linux/mm.py
index 193a88d763abf..7398105ff3f67 100644
--- a/scripts/gdb/linux/mm.py
+++ b/scripts/gdb/linux/mm.py
@@ -71,12 +71,8 @@ class x86_page_ops():
 
         self.NR_SECTION_ROOTS = DIV_ROUND_UP(self.NR_MEM_SECTIONS, self.SECTIONS_PER_ROOT)
 
-        try:
-            self.SECTION_HAS_MEM_MAP = 1 << int(gdb.parse_and_eval('SECTION_HAS_MEM_MAP_BIT'))
-            self.SECTION_IS_EARLY = 1 << int(gdb.parse_and_eval('SECTION_IS_EARLY_BIT'))
-        except:
-            self.SECTION_HAS_MEM_MAP = 1 << 0
-            self.SECTION_IS_EARLY = 1 << 3
+        self.SECTION_HAS_MEM_MAP = 1 << int(gdb.parse_and_eval('SECTION_HAS_MEM_MAP_BIT'))
+        self.SECTION_IS_EARLY = 1 << int(gdb.parse_and_eval('SECTION_IS_EARLY_BIT'))
 
         self.SUBSECTION_SHIFT = 21
         self.PAGES_PER_SUBSECTION = 1 << (self.SUBSECTION_SHIFT - self.PAGE_SHIFT)

-- 
2.43.0


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

* [PATCH v2 10/13] mm/sparse: remove SECTION_MARKED_PRESENT
  2026-09-21 19:58 [PATCH v2 00/13] mm/sparse: remove SECTION_MARKED_PRESENT and further cleanups David Hildenbrand (Arm)
                   ` (8 preceding siblings ...)
  2026-09-21 19:59 ` [PATCH v2 09/13] scripts/gdb: mm.py: remove fallbacks for SECTION_HAS_MEM_MAP and SECTION_IS_EARLY David Hildenbrand (Arm)
@ 2026-09-21 19:59 ` David Hildenbrand (Arm)
  2026-09-21 19:59 ` [PATCH v2 11/13] mm/sparse: remove flags parameter from sparse_init_one_section() David Hildenbrand (Arm)
                   ` (3 subsequent siblings)
  13 siblings, 0 replies; 16+ messages in thread
From: David Hildenbrand (Arm) @ 2026-09-21 19:59 UTC (permalink / raw)
  To: Andrew Morton, David Hildenbrand, Lorenzo Stoakes,
	Liam R. Howlett, Vlastimil Babka, Mike Rapoport,
	Suren Baghdasaryan, Michal Hocko, Kairui Song, Qi Zheng,
	Shakeel Butt, Barry Song, Axel Rasmussen, Yuanchu Xie, Wei Xu,
	Baoquan He, Baolin Wang, Brendan Jackman, Johannes Weiner,
	Zi Yan, Jan Kiszka, Kieran Bingham, Oscar Salvador,
	Greg Kroah-Hartman, Rafael J. Wysocki, Danilo Krummrich
  Cc: linux-kernel, linux-mm, linux-cxl, driver-core, linux-fsdevel

All present section iterators run before memory hotplug added any
further memory sections, Therefore, we can simply use the SECTION_IS_EARLY
flag by setting that flag earlier in sparse_sections_init().

Get rid of SECTION_MARKED_PRESENT entirely and rename
for_each_present_section_nr() to for_each_early_section_nr().

Take care of the .clang-format for_each_present_section_nr() handling.

No functional change intended.

Acked-by: Oscar Salvador <osalvador@suse.de>
Acked-by: Lorenzo Stoakes (ARM) <ljs@kernel.org>
Reviewed-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
Signed-off-by: David Hildenbrand (Arm) <david@kernel.org>
---
 .clang-format          |  2 +-
 drivers/base/memory.c  |  2 +-
 include/linux/mmzone.h | 27 ++++++++++-----------------
 mm/sparse-vmemmap.c    |  1 -
 mm/sparse.c            | 17 ++++++++---------
 mm/sparse.h            |  6 ------
 6 files changed, 20 insertions(+), 35 deletions(-)

diff --git a/.clang-format b/.clang-format
index 5ef5743b77c95..395292ab2ac63 100644
--- a/.clang-format
+++ b/.clang-format
@@ -282,6 +282,7 @@ ForEachMacros:
   - 'for_each_dpcm_fe'
   - 'for_each_drhd_unit'
   - 'for_each_dss_dev'
+  - 'for_each_early_section_nr'
   - 'for_each_efi_memory_desc'
   - 'for_each_efi_memory_desc_in_map'
   - 'for_each_element'
@@ -403,7 +404,6 @@ ForEachMacros:
   - 'for_each_possible_cpu_wrap'
   - 'for_each_present_blessed_reg'
   - 'for_each_present_cpu'
-  - 'for_each_present_section_nr'
   - 'for_each_prime_number'
   - 'for_each_prime_number_from'
   - 'for_each_probe_cache_entry'
diff --git a/drivers/base/memory.c b/drivers/base/memory.c
index 5eead3346f1e3..b0338de2f1d82 100644
--- a/drivers/base/memory.c
+++ b/drivers/base/memory.c
@@ -972,7 +972,7 @@ void __init memory_dev_init(void)
 	 * block so that it can be covered.
 	 */
 	block_id = ULONG_MAX;
-	for_each_present_section_nr(0, nr) {
+	for_each_early_section_nr(0, nr) {
 		if (block_id != ULONG_MAX && memory_block_id(nr) == block_id)
 			continue;
 
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
index a3937577fbfb2..73d9781cc1510 100644
--- a/include/linux/mmzone.h
+++ b/include/linux/mmzone.h
@@ -2085,7 +2085,6 @@ static inline struct mem_section *__nr_to_section(unsigned long nr)
  * accommodate SECTION_MAP_LAST_BIT. We use BUILD_BUG_ON() to ensure this.
  */
 enum {
-	SECTION_MARKED_PRESENT_BIT,
 	SECTION_HAS_MEM_MAP_BIT,
 	SECTION_IS_ONLINE_BIT,
 	SECTION_IS_EARLY_BIT,
@@ -2095,7 +2094,6 @@ enum {
 	SECTION_MAP_LAST_BIT,
 };
 
-#define SECTION_MARKED_PRESENT		BIT(SECTION_MARKED_PRESENT_BIT)
 #define SECTION_HAS_MEM_MAP		BIT(SECTION_HAS_MEM_MAP_BIT)
 #define SECTION_IS_ONLINE		BIT(SECTION_IS_ONLINE_BIT)
 #define SECTION_IS_EARLY		BIT(SECTION_IS_EARLY_BIT)
@@ -2112,16 +2110,6 @@ static inline struct page *__section_mem_map_addr(struct mem_section *section)
 	return (struct page *)map;
 }
 
-static inline int present_section(const struct mem_section *section)
-{
-	return (section && (section->section_mem_map & SECTION_MARKED_PRESENT));
-}
-
-static inline int present_section_nr(unsigned long nr)
-{
-	return present_section(__nr_to_section(nr));
-}
-
 static inline int valid_section(const struct mem_section *section)
 {
 	return (section && (section->section_mem_map & SECTION_HAS_MEM_MAP));
@@ -2137,6 +2125,11 @@ static inline int valid_section_nr(unsigned long nr)
 	return valid_section(__nr_to_section(nr));
 }
 
+static inline int early_section_nr(unsigned long nr)
+{
+	return early_section(__nr_to_section(nr));
+}
+
 static inline int online_section(const struct mem_section *section)
 {
 	return (section && (section->section_mem_map & SECTION_IS_ONLINE));
@@ -2326,20 +2319,20 @@ static inline unsigned long next_valid_pfn(unsigned long pfn, unsigned long end_
 
 #endif
 
-static inline unsigned long next_present_section_nr(unsigned long section_nr)
+static inline unsigned long next_early_section_nr(unsigned long section_nr)
 {
 	while (++section_nr <= __highest_used_section_nr) {
-		if (present_section_nr(section_nr))
+		if (early_section_nr(section_nr))
 			return section_nr;
 	}
 
 	return -1;
 }
 
-#define for_each_present_section_nr(start, section_nr)		\
-	for (section_nr = next_present_section_nr(start - 1);	\
+#define for_each_early_section_nr(start, section_nr)		\
+	for (section_nr = next_early_section_nr(start - 1);	\
 	     section_nr != -1;					\
-	     section_nr = next_present_section_nr(section_nr))
+	     section_nr = next_early_section_nr(section_nr))
 
 /*
  * These are _only_ used during initialisation, therefore they
diff --git a/mm/sparse-vmemmap.c b/mm/sparse-vmemmap.c
index e89efb67e8e6d..f0db433e0f10b 100644
--- a/mm/sparse-vmemmap.c
+++ b/mm/sparse-vmemmap.c
@@ -864,7 +864,6 @@ int __meminit sparse_add_section(int nid, unsigned long start_pfn,
 	if (!section_vmemmap_optimizable(ms))
 		page_init_poison(memmap, sizeof(struct page) * nr_pages);
 
-	__section_mark_present(ms, section_nr);
 	__highest_used_section_nr = max(section_nr, __highest_used_section_nr);
 
 	/* Align memmap to section boundary in the subsection case */
diff --git a/mm/sparse.c b/mm/sparse.c
index a0f50ca5acf5a..5d2d9f95d4024 100644
--- a/mm/sparse.c
+++ b/mm/sparse.c
@@ -170,13 +170,14 @@ static void __init mminit_validate_memmodel_limits(unsigned long *start_pfn,
  */
 unsigned long __highest_used_section_nr;
 
-static inline unsigned long first_present_section_nr(void)
+static inline unsigned long first_early_section_nr(void)
 {
-	return next_present_section_nr(-1);
+	return next_early_section_nr(-1);
 }
 
 void __init sparse_sections_init(void)
 {
+	const unsigned long flags = SECTION_IS_EARLY | SECTION_IS_ONLINE;
 	unsigned long pfn, start_pfn, end_pfn, section_nr;
 	int i, nid;
 
@@ -196,9 +197,7 @@ void __init sparse_sections_init(void)
 				continue;
 
 			set_section_nid(section_nr, nid);
-			ms->section_mem_map = sparse_encode_early_nid(nid) |
-							SECTION_IS_ONLINE;
-			__section_mark_present(ms, section_nr);
+			ms->section_mem_map = sparse_encode_early_nid(nid) | flags;
 		}
 	}
 	__highest_used_section_nr = section_nr;
@@ -230,7 +229,7 @@ static void __init sparse_metadata_init_nid(int nid,
 	if (!usage)
 		panic("Failed to allocate usemap for node %d\n", nid);
 
-	for_each_present_section_nr(start_section_nr, section_nr) {
+	for_each_early_section_nr(start_section_nr, section_nr) {
 		const unsigned long pfn = section_nr_to_pfn(section_nr);
 		struct page *mem_map;
 
@@ -244,18 +243,18 @@ static void __init sparse_metadata_init_nid(int nid,
 			      section_nr);
 		memmap_boot_pages_add(section_nr_vmemmap_pages(pfn, PAGES_PER_SECTION));
 		sparse_init_one_section(__nr_to_section(section_nr), section_nr,
-					mem_map, usage, SECTION_IS_EARLY);
+					mem_map, usage, 0);
 		usage = (void *)usage + mem_section_usage_size();
 	}
 }
 
 static void __init sparse_metadata_init(void)
 {
-	unsigned long start_section_nr = first_present_section_nr();
+	unsigned long start_section_nr = first_early_section_nr();
 	int nid_begin = sparse_early_nid(__nr_to_section(start_section_nr));
 	unsigned long section_nr, nr_sections = 1;
 
-	for_each_present_section_nr(start_section_nr + 1, section_nr) {
+	for_each_early_section_nr(start_section_nr + 1, section_nr) {
 		const int nid = sparse_early_nid(__nr_to_section(section_nr));
 
 		if (nid == nid_begin) {
diff --git a/mm/sparse.h b/mm/sparse.h
index c396d5c05cfc8..19664d702af84 100644
--- a/mm/sparse.h
+++ b/mm/sparse.h
@@ -42,12 +42,6 @@ static inline void sparse_init_one_section(struct mem_section *ms,
 	ms->usage = usage;
 }
 
-static inline void __section_mark_present(struct mem_section *ms,
-		unsigned long section_nr)
-{
-	ms->section_mem_map |= SECTION_MARKED_PRESENT;
-}
-
 static inline size_t mem_section_usage_size(void)
 {
 	return struct_size_t(struct mem_section_usage, pageblock_flags,

-- 
2.43.0


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

* [PATCH v2 11/13] mm/sparse: remove flags parameter from sparse_init_one_section()
  2026-09-21 19:58 [PATCH v2 00/13] mm/sparse: remove SECTION_MARKED_PRESENT and further cleanups David Hildenbrand (Arm)
                   ` (9 preceding siblings ...)
  2026-09-21 19:59 ` [PATCH v2 10/13] mm/sparse: remove SECTION_MARKED_PRESENT David Hildenbrand (Arm)
@ 2026-09-21 19:59 ` David Hildenbrand (Arm)
  2026-09-21 19:59 ` [PATCH v2 12/13] fs/proc/page: clarify comment in get_max_dump_pfn() David Hildenbrand (Arm)
                   ` (2 subsequent siblings)
  13 siblings, 0 replies; 16+ messages in thread
From: David Hildenbrand (Arm) @ 2026-09-21 19:59 UTC (permalink / raw)
  To: Andrew Morton, David Hildenbrand, Lorenzo Stoakes,
	Liam R. Howlett, Vlastimil Babka, Mike Rapoport,
	Suren Baghdasaryan, Michal Hocko, Kairui Song, Qi Zheng,
	Shakeel Butt, Barry Song, Axel Rasmussen, Yuanchu Xie, Wei Xu,
	Baoquan He, Baolin Wang, Brendan Jackman, Johannes Weiner,
	Zi Yan, Jan Kiszka, Kieran Bingham, Oscar Salvador,
	Greg Kroah-Hartman, Rafael J. Wysocki, Danilo Krummrich
  Cc: linux-kernel, linux-mm, linux-cxl, driver-core, linux-fsdevel

The last user of the flags parameter that used to pass SECTION_IS_EARLY
was removed, so let's remove the parameter.

Acked-by: Oscar Salvador <osalvador@suse.de>
Reviewed-by: Lorenzo Stoakes (ARM) <ljs@kernel.org>
Reviewed-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
Signed-off-by: David Hildenbrand (Arm) <david@kernel.org>
---
 mm/sparse-vmemmap.c | 2 +-
 mm/sparse.c         | 2 +-
 mm/sparse.h         | 5 ++---
 3 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/mm/sparse-vmemmap.c b/mm/sparse-vmemmap.c
index f0db433e0f10b..3267f9362c68b 100644
--- a/mm/sparse-vmemmap.c
+++ b/mm/sparse-vmemmap.c
@@ -869,7 +869,7 @@ int __meminit sparse_add_section(int nid, unsigned long start_pfn,
 	/* Align memmap to section boundary in the subsection case */
 	if (section_nr_to_pfn(section_nr) != start_pfn)
 		memmap = pfn_to_page(section_nr_to_pfn(section_nr));
-	sparse_init_one_section(ms, section_nr, memmap, ms->usage, 0);
+	sparse_init_one_section(ms, section_nr, memmap, ms->usage);
 
 	return 0;
 }
diff --git a/mm/sparse.c b/mm/sparse.c
index 5d2d9f95d4024..702904b417006 100644
--- a/mm/sparse.c
+++ b/mm/sparse.c
@@ -243,7 +243,7 @@ static void __init sparse_metadata_init_nid(int nid,
 			      section_nr);
 		memmap_boot_pages_add(section_nr_vmemmap_pages(pfn, PAGES_PER_SECTION));
 		sparse_init_one_section(__nr_to_section(section_nr), section_nr,
-					mem_map, usage, 0);
+					mem_map, usage);
 		usage = (void *)usage + mem_section_usage_size();
 	}
 }
diff --git a/mm/sparse.h b/mm/sparse.h
index 19664d702af84..fdbc4cacf91d1 100644
--- a/mm/sparse.h
+++ b/mm/sparse.h
@@ -21,7 +21,7 @@ int sparse_index_init(unsigned long section_nr, int nid);
 
 static inline void sparse_init_one_section(struct mem_section *ms,
 		unsigned long section_nr, struct page *mem_map,
-		struct mem_section_usage *usage, unsigned long flags)
+		struct mem_section_usage *usage)
 {
 	unsigned long coded_mem_map;
 
@@ -37,8 +37,7 @@ static inline void sparse_init_one_section(struct mem_section *ms,
 	VM_WARN_ON_ONCE(coded_mem_map & ~SECTION_MAP_MASK);
 
 	ms->section_mem_map &= ~SECTION_MAP_MASK;
-	ms->section_mem_map |= coded_mem_map;
-	ms->section_mem_map |= flags | SECTION_HAS_MEM_MAP;
+	ms->section_mem_map |= coded_mem_map | SECTION_HAS_MEM_MAP;
 	ms->usage = usage;
 }
 

-- 
2.43.0


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

* [PATCH v2 12/13] fs/proc/page: clarify comment in get_max_dump_pfn()
  2026-09-21 19:58 [PATCH v2 00/13] mm/sparse: remove SECTION_MARKED_PRESENT and further cleanups David Hildenbrand (Arm)
                   ` (10 preceding siblings ...)
  2026-09-21 19:59 ` [PATCH v2 11/13] mm/sparse: remove flags parameter from sparse_init_one_section() David Hildenbrand (Arm)
@ 2026-09-21 19:59 ` David Hildenbrand (Arm)
  2026-09-21 19:59 ` [PATCH v2 13/13] mm/memory_hotplug: drop CONFIG_HAVE_ARCH_PFN_VALID handling from pfn_to_online_page() David Hildenbrand (Arm)
  2026-09-21 22:53 ` [PATCH v2 00/13] mm/sparse: remove SECTION_MARKED_PRESENT and further cleanups Andrew Morton
  13 siblings, 0 replies; 16+ messages in thread
From: David Hildenbrand (Arm) @ 2026-09-21 19:59 UTC (permalink / raw)
  To: Andrew Morton, David Hildenbrand, Lorenzo Stoakes,
	Liam R. Howlett, Vlastimil Babka, Mike Rapoport,
	Suren Baghdasaryan, Michal Hocko, Kairui Song, Qi Zheng,
	Shakeel Butt, Barry Song, Axel Rasmussen, Yuanchu Xie, Wei Xu,
	Baoquan He, Baolin Wang, Brendan Jackman, Johannes Weiner,
	Zi Yan, Jan Kiszka, Kieran Bingham, Oscar Salvador,
	Greg Kroah-Hartman, Rafael J. Wysocki, Danilo Krummrich
  Cc: linux-kernel, linux-mm, linux-cxl, driver-core, linux-fsdevel

pfn_to_online_page() will only succeed on some PFNs within the same
section, not necessarily all. Let's make that clearer.

While at it, rephrase it to "Allow inspection of".

Acked-by: Oscar Salvador <osalvador@suse.de>
Acked-by: Lorenzo Stoakes (ARM) <ljs@kernel.org>
Reviewed-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
Signed-off-by: David Hildenbrand (Arm) <david@kernel.org>
---
 fs/proc/page.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/fs/proc/page.c b/fs/proc/page.c
index f90e1030825e9..6aa99e42ec222 100644
--- a/fs/proc/page.c
+++ b/fs/proc/page.c
@@ -31,10 +31,9 @@ static inline unsigned long get_max_dump_pfn(void)
 {
 #ifdef CONFIG_SPARSEMEM
 	/*
-	 * The memmap of early sections is completely populated and marked
-	 * online even if max_pfn does not fall on a section boundary -
-	 * pfn_to_online_page() will succeed on all pages. Allow inspecting
-	 * these memmaps.
+	 * If max_pfn does not fall on a section boundary, pfn_to_online_page()
+	 * can succeed on PFNs beyond max_pfn within the same section. Allow
+	 * inspection of these memmaps.
 	 */
 	return round_up(max_pfn, PAGES_PER_SECTION);
 #else

-- 
2.43.0


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

* [PATCH v2 13/13] mm/memory_hotplug: drop CONFIG_HAVE_ARCH_PFN_VALID handling from pfn_to_online_page()
  2026-09-21 19:58 [PATCH v2 00/13] mm/sparse: remove SECTION_MARKED_PRESENT and further cleanups David Hildenbrand (Arm)
                   ` (11 preceding siblings ...)
  2026-09-21 19:59 ` [PATCH v2 12/13] fs/proc/page: clarify comment in get_max_dump_pfn() David Hildenbrand (Arm)
@ 2026-09-21 19:59 ` David Hildenbrand (Arm)
  2026-09-21 22:53 ` [PATCH v2 00/13] mm/sparse: remove SECTION_MARKED_PRESENT and further cleanups Andrew Morton
  13 siblings, 0 replies; 16+ messages in thread
From: David Hildenbrand (Arm) @ 2026-09-21 19:59 UTC (permalink / raw)
  To: Andrew Morton, David Hildenbrand, Lorenzo Stoakes,
	Liam R. Howlett, Vlastimil Babka, Mike Rapoport,
	Suren Baghdasaryan, Michal Hocko, Kairui Song, Qi Zheng,
	Shakeel Butt, Barry Song, Axel Rasmussen, Yuanchu Xie, Wei Xu,
	Baoquan He, Baolin Wang, Brendan Jackman, Johannes Weiner,
	Zi Yan, Jan Kiszka, Kieran Bingham, Oscar Salvador,
	Greg Kroah-Hartman, Rafael J. Wysocki, Danilo Krummrich
  Cc: linux-kernel, linux-mm, linux-cxl, driver-core, linux-fsdevel

Drop CONFIG_HAVE_ARCH_PFN_VALID handling, as CONFIG_HAVE_ARCH_PFN_VALID
is never used with CONFIG_MEMORY_HOTPLUG, as the latter depends on
CONFIG_SPARSEMEM_VMEMMAP. Make sure it stays that way.

Reviewed-by: Lorenzo Stoakes (ARM) <ljs@kernel.org>
Reviewed-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
Signed-off-by: David Hildenbrand (Arm) <david@kernel.org>
---
 mm/memory_hotplug.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
index d7a59167bec43..796af1028ee23 100644
--- a/mm/memory_hotplug.c
+++ b/mm/memory_hotplug.c
@@ -345,6 +345,8 @@ struct page *pfn_to_online_page(unsigned long pfn)
 	struct dev_pagemap *pgmap;
 	struct mem_section *ms;
 
+	BUILD_BUG_ON(IS_ENABLED(CONFIG_HAVE_ARCH_PFN_VALID));
+
 	if (nr >= NR_MEM_SECTIONS)
 		return NULL;
 
@@ -352,13 +354,6 @@ struct page *pfn_to_online_page(unsigned long pfn)
 	if (!online_section(ms))
 		return NULL;
 
-	/*
-	 * Save some code text when online_section() +
-	 * pfn_section_valid() are sufficient.
-	 */
-	if (IS_ENABLED(CONFIG_HAVE_ARCH_PFN_VALID) && !pfn_valid(pfn))
-		return NULL;
-
 	if (!pfn_section_valid(ms, pfn))
 		return NULL;
 

-- 
2.43.0


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

* Re: [PATCH v2 00/13] mm/sparse: remove SECTION_MARKED_PRESENT and further cleanups
  2026-09-21 19:58 [PATCH v2 00/13] mm/sparse: remove SECTION_MARKED_PRESENT and further cleanups David Hildenbrand (Arm)
                   ` (12 preceding siblings ...)
  2026-09-21 19:59 ` [PATCH v2 13/13] mm/memory_hotplug: drop CONFIG_HAVE_ARCH_PFN_VALID handling from pfn_to_online_page() David Hildenbrand (Arm)
@ 2026-09-21 22:53 ` Andrew Morton
  13 siblings, 0 replies; 16+ messages in thread
From: Andrew Morton @ 2026-09-21 22:53 UTC (permalink / raw)
  To: David Hildenbrand (Arm)
  Cc: Lorenzo Stoakes, Liam R. Howlett, Vlastimil Babka, Mike Rapoport,
	Suren Baghdasaryan, Michal Hocko, Kairui Song, Qi Zheng,
	Shakeel Butt, Barry Song, Axel Rasmussen, Yuanchu Xie, Wei Xu,
	Baoquan He, Baolin Wang, Brendan Jackman, Johannes Weiner,
	Zi Yan, Jan Kiszka, Kieran Bingham, Oscar Salvador,
	Greg Kroah-Hartman, Rafael J. Wysocki, Danilo Krummrich,
	linux-kernel, linux-mm, linux-cxl, driver-core, linux-fsdevel,
	Seongjun Hong

On Mon, 21 Sep 2026 21:58:52 +0200 "David Hildenbrand (Arm)" <david@kernel.org> wrote:

> SECTION_MARKED_PRESENT is really only needed during boot, where we
> can instead just rely on SECTION_IS_EARLY_BIT by setting that flag
> earlier.
> 
> Some preparations for doing that conversion and some cleanups in the same
> (sparse) area.

Added to mm-new, thanks.



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

* Re: [PATCH v2 01/13] mm/sparse: move mem_section init to sparse_extreme_init()
  2026-09-21 19:58 ` [PATCH v2 01/13] mm/sparse: move mem_section init to sparse_extreme_init() David Hildenbrand (Arm)
@ 2026-09-21 23:12   ` Zi Yan
  0 siblings, 0 replies; 16+ messages in thread
From: Zi Yan @ 2026-09-21 23:12 UTC (permalink / raw)
  To: David Hildenbrand (Arm),
	Andrew Morton, Lorenzo Stoakes, Liam R. Howlett, Vlastimil Babka,
	Mike Rapoport, Suren Baghdasaryan, Michal Hocko, Kairui Song,
	Qi Zheng, Shakeel Butt, Barry Song, Axel Rasmussen, Yuanchu Xie,
	Wei Xu, Baoquan He, Baolin Wang, Brendan Jackman,
	Johannes Weiner, Jan Kiszka, Kieran Bingham, Oscar Salvador,
	Greg Kroah-Hartman, Rafael J. Wysocki, Danilo Krummrich
  Cc: linux-kernel, linux-mm, linux-cxl, driver-core, linux-fsdevel

On Mon Sep 21, 2026 at 3:58 PM EDT, David Hildenbrand (Arm) wrote:
> Let's just avoid another pair of ifdef inside a function. While at it,
> switch to INTERNODE_CACHE_BYTES by just defining a fallback in cache.h
> as well, given that the x86 variant already provides one.
>
> Acked-by: Oscar Salvador <osalvador@suse.de>
> Reviewed-by: Lorenzo Stoakes (ARM) <ljs@kernel.org>
> Reviewed-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
> Signed-off-by: David Hildenbrand (Arm) <david@kernel.org>
> ---
>  include/linux/cache.h |  1 +
>  mm/sparse.c           | 19 ++++++++++++-------
>  2 files changed, 13 insertions(+), 7 deletions(-)
>
LGTM.

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

-- 
Best Regards,
Yan, Zi


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

end of thread, other threads:[~2026-09-21 23:12 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-21 19:58 [PATCH v2 00/13] mm/sparse: remove SECTION_MARKED_PRESENT and further cleanups David Hildenbrand (Arm)
2026-09-21 19:58 ` [PATCH v2 01/13] mm/sparse: move mem_section init to sparse_extreme_init() David Hildenbrand (Arm)
2026-09-21 23:12   ` Zi Yan
2026-09-21 19:58 ` [PATCH v2 02/13] mm/sparse: refactor sparse_sections_init() David Hildenbrand (Arm)
2026-09-21 19:58 ` [PATCH v2 03/13] mm/sparse: move initialization of section metadata to sparse_metadata_init() David Hildenbrand (Arm)
2026-09-21 19:58 ` [PATCH v2 04/13] mm/sparse: rename and cleanup sparse_init_nid() David Hildenbrand (Arm)
2026-09-21 19:58 ` [PATCH v2 05/13] mm/sparse: cleanup sparse_init_one_section() David Hildenbrand (Arm)
2026-09-21 19:58 ` [PATCH v2 06/13] mm/sparse: rename __highest_present_section_nr to __highest_used_section_nr David Hildenbrand (Arm)
2026-09-21 19:58 ` [PATCH v2 07/13] mm/sparse: remove pfn_in_present_section() David Hildenbrand (Arm)
2026-09-21 19:59 ` [PATCH v2 08/13] mm/sparse: move __highest_used_section_nr handling David Hildenbrand (Arm)
2026-09-21 19:59 ` [PATCH v2 09/13] scripts/gdb: mm.py: remove fallbacks for SECTION_HAS_MEM_MAP and SECTION_IS_EARLY David Hildenbrand (Arm)
2026-09-21 19:59 ` [PATCH v2 10/13] mm/sparse: remove SECTION_MARKED_PRESENT David Hildenbrand (Arm)
2026-09-21 19:59 ` [PATCH v2 11/13] mm/sparse: remove flags parameter from sparse_init_one_section() David Hildenbrand (Arm)
2026-09-21 19:59 ` [PATCH v2 12/13] fs/proc/page: clarify comment in get_max_dump_pfn() David Hildenbrand (Arm)
2026-09-21 19:59 ` [PATCH v2 13/13] mm/memory_hotplug: drop CONFIG_HAVE_ARCH_PFN_VALID handling from pfn_to_online_page() David Hildenbrand (Arm)
2026-09-21 22:53 ` [PATCH v2 00/13] mm/sparse: remove SECTION_MARKED_PRESENT and further cleanups Andrew Morton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®