summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorDavid Hildenbrand (Arm) <david@kernel.org>2026-07-16 16:51:03 +0200
committerAndrew Morton <akpm@linux-foundation.org>2026-08-04 19:18:41 -0700
commitf4436442e5999bf63315a67803819c48a886d132 (patch)
treeebfabeffe4dda905e675b0cc5271d502d985e688 /include/linux
parentcbbd561893f65e2b31cf9c18634405cb8d8bf6f0 (diff)
mm/bootmem_info: allow calling free_bootmem_page() on pages without a bootmem_type
As preparation for further changes, let's temporarily allow freeing pages that were not previously registered. This will allow freeing unregistered vmemmap pages allocated during boot through free_bootmem_page() from hugetlb code, until we fully rip all of that out. Link: https://lore.kernel.org/20260716-bootmem_info_part2-v2-4-4afc76c73d61@kernel.org Signed-off-by: David Hildenbrand (Arm) <david@kernel.org> Reviewed-by: Mike Rapoport (Microsoft) <rppt@kernel.org> Reviewed-by: Muchun Song <muchun.song@linux.dev> Acked-by: Zi Yan <ziy@nvidia.com> Reviewed-by: Dave Hansen <dave.hansen@linux.intel.com> Cc: Alexander Gordeev <agordeev@linux.ibm.com> Cc: Andy Lutomirski <luto@kernel.org> Cc: "Borislav Petkov (AMD)" <bp@alien8.de> Cc: Brendan Jackman <jackmanb@google.com> Cc: Brendan Jackman <brendan.jackman@linux.dev> Cc: Christian Borntraeger <borntraeger@linux.ibm.com> Cc: Gerald Schaefer <gerald.schaefer@linux.ibm.com> Cc: Heiko Carstens <hca@linux.ibm.com> Cc: "H. Peter Anvin" <hpa@zytor.com> Cc: Ingo Molnar <mingo@redhat.com> Cc: Johannes Weiner <hannes@cmpxchg.org> Cc: Liam R. Howlett <liam@infradead.org> Cc: Lorenzo Stoakes <ljs@kernel.org> Cc: Michal Hocko <mhocko@suse.com> Cc: Oscar Salvador <osalvador@suse.de> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Suren Baghdasaryan <surenb@google.com> Cc: Sven Schnelle <svens@linux.ibm.com> Cc: Vasily Gorbik <gor@linux.ibm.com> Cc: Vlastimil Babka <vbabka@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/bootmem_info.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/include/linux/bootmem_info.h b/include/linux/bootmem_info.h
index f724340755e5..486acc612703 100644
--- a/include/linux/bootmem_info.h
+++ b/include/linux/bootmem_info.h
@@ -44,12 +44,12 @@ static inline void free_bootmem_page(struct page *page)
{
enum bootmem_type type = bootmem_type(page);
- VM_BUG_ON_PAGE(page_ref_count(page) != 2, page);
-
- if (type == SECTION_INFO || type == MIX_SECTION_INFO)
+ if (type == SECTION_INFO || type == MIX_SECTION_INFO) {
+ VM_WARN_ON_PAGE(page_ref_count(page) != 2, page);
put_page_bootmem(page);
- else
- VM_BUG_ON_PAGE(1, page);
+ } else {
+ free_reserved_page(page);
+ }
}
#else
static inline void register_page_bootmem_info_node(struct pglist_data *pgdat)