[PATCH v2 00/10] mm: remove CONFIG_HAVE_BOOTMEM_INFO_NODE (Part 2)

David Hildenbrand (Arm) posted 10 patches 1 week, 2 days ago
MAINTAINERS                  |   1 -
arch/s390/mm/vmem.c          |   4 +-
arch/x86/mm/init_64.c        | 134 ++++---------------------------------------
include/linux/bootmem_info.h |  89 ----------------------------
include/linux/mm.h           |   8 ++-
mm/Kconfig                   |   8 ---
mm/Makefile                  |   1 -
mm/bootmem_info.c            |  72 -----------------------
mm/hugetlb_vmemmap.c         |   8 +--
mm/page_alloc.c              |  33 ++++++++---
mm/sparse.c                  |   1 -
11 files changed, 46 insertions(+), 313 deletions(-)
[PATCH v2 00/10] mm: remove CONFIG_HAVE_BOOTMEM_INFO_NODE (Part 2)
Posted by David Hildenbrand (Arm) 1 week, 2 days ago
Let's remove the remaining pieces of CONFIG_HAVE_BOOTMEM_INFO_NODE,
performing some smaller cleanups around freeing of reserved vmemmap
pages on the way.

Tested on x86-64 with hugetlb vmemmap optimization in combination with
KMEMLEAK. Heavily cross-compiled.

Signed-off-by: David Hildenbrand (Arm) <david@kernel.org>
---
Changes in v2:
- In patch #2, reverse the order of setting the page count and clearing
  PG_reserved, and modify the patch description accordingly.
- Link to v1: https://patch.msgid.link/20260708-bootmem_info_part2-v1-0-156ce4986598@kernel.org

---

David Hildenbrand (Arm) (10):
      x86/mm: drop order parameter from free_pagetable()
      mm: provide free_reserved_pages(), removing x86 variant
      s390/mm: use free_reserved_pages() in vmem_free_pages()
      mm/bootmem_info: allow calling free_bootmem_page() on pages without a bootmem_type
      x86/mm: stop marking vmemmap as SECTION_INFO
      x86/mm: stop marking page tables as MIX_SECTION_INFO
      x86/mm: remove CONFIG_HAVE_BOOTMEM_INFO_NODE
      mm/hugetlb_vmemmap: remove bootmem_info leftovers
      mm/sparse: remove bootmem_info.h include
      mm/bootmem_info: remove CONFIG_HAVE_BOOTMEM_INFO_NODE

 MAINTAINERS                  |   1 -
 arch/s390/mm/vmem.c          |   4 +-
 arch/x86/mm/init_64.c        | 134 ++++---------------------------------------
 include/linux/bootmem_info.h |  89 ----------------------------
 include/linux/mm.h           |   8 ++-
 mm/Kconfig                   |   8 ---
 mm/Makefile                  |   1 -
 mm/bootmem_info.c            |  72 -----------------------
 mm/hugetlb_vmemmap.c         |   8 +--
 mm/page_alloc.c              |  33 ++++++++---
 mm/sparse.c                  |   1 -
 11 files changed, 46 insertions(+), 313 deletions(-)

---

base-commit: d11ba1f570615ec8d4814d6313ee1d7075a33787

change-id: 20260428-bootmem_info_part2-4bbb445d9b3d

--

Cheers,

David
Re: [PATCH v2 00/10] mm: remove CONFIG_HAVE_BOOTMEM_INFO_NODE (Part 2)
Posted by Dave Hansen 1 week, 1 day ago
On 7/16/26 07:50, David Hildenbrand (Arm) wrote:
>  arch/x86/mm/init_64.c        | 134 ++++---------------------------------------

Uhhh. Wow. <blink><blink><blink>

This is a really big win. Thanks for doing this!

I assume the plan is to take this series through the mm route?

Reviewed-by: Dave Hansen <dave.hansen@linux.intel.com>
Re: [PATCH v2 00/10] mm: remove CONFIG_HAVE_BOOTMEM_INFO_NODE (Part 2)
Posted by David Hildenbrand (Arm) 1 week, 1 day ago
On 7/16/26 18:19, Dave Hansen wrote:
> On 7/16/26 07:50, David Hildenbrand (Arm) wrote:
>>  arch/x86/mm/init_64.c        | 134 ++++---------------------------------------
> 
> Uhhh. Wow. <blink><blink><blink>
> 
> This is a really big win. Thanks for doing this!

Thanks!

Next step is to merge CONFIG_MEMORY_HOTPLUG and CONFIG_MEMORY_HOTUNPLUG.

It will look nice, but not this nice :)

-- 
Cheers,

David
Re: [PATCH v2 00/10] mm: remove CONFIG_HAVE_BOOTMEM_INFO_NODE (Part 2)
Posted by Andrew Morton 1 week, 1 day ago
On Thu, 16 Jul 2026 16:50:59 +0200 "David Hildenbrand (Arm)" <david@kernel.org> wrote:

> Let's remove the remaining pieces of CONFIG_HAVE_BOOTMEM_INFO_NODE,
> performing some smaller cleanups around freeing of reserved vmemmap
> pages on the way.
> 
> Tested on x86-64 with hugetlb vmemmap optimization in combination with
> KMEMLEAK. Heavily cross-compiled.
> 

Thanks, I updated mm-unstable to this version.

> Changes in v2:
> - In patch #2, reverse the order of setting the page count and clearing
>   PG_reserved, and modify the patch description accordingly.

Here's how v2 altered mm.git:

--- a/mm/page_alloc.c~3
+++ a/mm/page_alloc.c
@@ -6410,8 +6410,8 @@ void free_reserved_pages(struct page *pa
 
 	for (i = 0; i < nr_pages; i++) {
 		clear_page_tag_ref(page + i);
-		set_page_count(page + i, 0);
 		ClearPageReserved(page + i);
+		set_page_count(page + i, 0);
 	}
 	adjust_managed_page_count(page, nr_pages);
 	__free_frozen_pages(page, order, FPI_NONE);
_