The patch titled Subject: mm: convert page type macros to enum has been added to the -mm mm-unstable branch. Its filename is mm-convert-page-type-macros-to-enum.patch This patch will shortly appear at https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/mm-convert-page-type-macros-to-enum.patch This patch will later appear in the mm-unstable branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next via the mm-everything branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm and is updated there every 2-3 working days ------------------------------------------------------ From: Stephen Brennan <stephen.s.brennan@xxxxxxxxxx> Subject: mm: convert page type macros to enum Date: Fri, 7 Jun 2024 13:29:53 -0700 Changing PG_slab from a page flag to a page type in commit 46df8e73a4a3 ("mm: free up PG_slab") in has the unintended consequence of removing the PG_slab constant from kernel debuginfo. The commit does add the value to the vmcoreinfo note, which allows debuggers to find the value without hardcoding it. However it's most flexible to continue representing the constant with an enum. To that end, convert the page type fields into an enum. Debuggers will now be able to detect that PG_slab's type has changed from enum pageflags to enum pagetype. Link: https://lkml.kernel.org/r/20240607202954.1198180-1-stephen.s.brennan@xxxxxxxxxx Fixes: 46df8e73a4a3 ("mm: free up PG_slab") Signed-off-by: Stephen Brennan <stephen.s.brennan@xxxxxxxxxx> Cc: David Hildenbrand <david@xxxxxxxxxx> Cc: Hao Ge <gehao@xxxxxxxxxx> Cc: Matthew Wilcox (Oracle) <willy@xxxxxxxxxxxxx> Cc: Omar Sandoval <osandov@xxxxxxxxxxx> Cc: Vishal Moola (Oracle) <vishal.moola@xxxxxxxxx> Cc: Vlastimil Babka <vbabka@xxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- include/linux/page-flags.h | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) --- a/include/linux/page-flags.h~mm-convert-page-type-macros-to-enum +++ a/include/linux/page-flags.h @@ -940,20 +940,23 @@ PAGEFLAG_FALSE(HasHWPoisoned, has_hwpois * mistaken for a page type value. */ -#define PAGE_TYPE_BASE 0x80000000 -/* - * Reserve 0xffff0000 - 0xfffffffe to catch _mapcount underflows and - * allow owners that set a type to reuse the lower 16 bit for their own - * purposes. - */ -#define PG_buddy 0x40000000 -#define PG_offline 0x20000000 -#define PG_table 0x10000000 -#define PG_guard 0x08000000 -#define PG_hugetlb 0x04000000 -#define PG_slab 0x02000000 -#define PG_zsmalloc 0x01000000 -#define PAGE_MAPCOUNT_RESERVE (~0x0000ffff) +enum pagetype { + /* + * Reserve 0xffff0000 - 0xfffffffe to catch _mapcount underflows and + * allow owners that set a type to reuse the lower 16 bit for their own + * purposes. + */ + PG_buddy = 0x40000000, + PG_offline = 0x20000000, + PG_table = 0x10000000, + PG_guard = 0x08000000, + PG_hugetlb = 0x04000000, + PG_slab = 0x02000000, + PG_zsmalloc = 0x01000000, + + PAGE_TYPE_BASE = 0x80000000, + PAGE_MAPCOUNT_RESERVE = ~0x0000ffff, +}; #define PageType(page, flag) \ ((page->page_type & (PAGE_TYPE_BASE | flag)) == PAGE_TYPE_BASE) _ Patches currently in -mm which might be from stephen.s.brennan@xxxxxxxxxx are mm-convert-page-type-macros-to-enum.patch