[PATCH 00/12] mm/sparse: remove SECTION_MARKED_PRESENT and further cleanups

David Hildenbrand (Arm) posted 12 patches 2 weeks, 2 days ago
There is a newer version of this series
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     |   3 +-
mm/sparse.c             | 160 +++++++++++++++++++++++-------------------------
mm/sparse.h             |  21 +++----
scripts/gdb/linux/mm.py |   2 +-
10 files changed, 107 insertions(+), 143 deletions(-)
[PATCH 00/12] mm/sparse: remove SECTION_MARKED_PRESENT and further cleanups
Posted by David Hildenbrand (Arm) 2 weeks, 2 days ago
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.

This is based on mm-unstable which carries Muchun's

	"[PATCH v5 00/17] mm: Introduce section-based vmemmap optimization
	 for HugeTLB" [1]

A (possible) resend from Muchun should only result in smaller conflicts.

[1] https://lore.kernel.org/r/20260825084608.47437-1-songmuchun@bytedance.com 

Signed-off-by: David Hildenbrand (Arm) <david@kernel.org>
---
David Hildenbrand (Arm) (12):
      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
      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()

 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     |   3 +-
 mm/sparse.c             | 160 +++++++++++++++++++++++-------------------------
 mm/sparse.h             |  21 +++----
 scripts/gdb/linux/mm.py |   2 +-
 10 files changed, 107 insertions(+), 143 deletions(-)

---

base-commit: b02c77c78ff74d3d88ea614335ae833e01ed5d30

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

--

Cheers,

David
Re: [PATCH 00/12] mm/sparse: remove SECTION_MARKED_PRESENT and further cleanups
Posted by Mike Rapoport 1 week, 4 days ago
On Wed, 09 Sep 2026 15:32:53 +0200, David Hildenbrand (Arm) <david@kernel.org> wrote:
> mm/sparse: remove SECTION_MARKED_PRESENT and further cleanups
> 
> 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.
> 
> [...]

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

-- 
Sincerely yours,
Mike.
Re: [PATCH 00/12] mm/sparse: remove SECTION_MARKED_PRESENT and further cleanups
Posted by David Hildenbrand (Arm) 1 week, 4 days ago
On 9/14/26 11:45, Mike Rapoport wrote:
> On Wed, 09 Sep 2026 15:32:53 +0200, David Hildenbrand (Arm) <david@kernel.org> wrote:
>> mm/sparse: remove SECTION_MARKED_PRESENT and further cleanups
>>
>> 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.
>>
>> [...]
> 
> Reviewed-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
> 

Thanks for the review!

-- 
Cheers,

David