Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

crash: export PAGE_UNACCEPTED_MAPCOUNT_VALUE to vmcoreinfo

On Intel TDX guest, unaccepted memory is unusable free memory which is not
managed by buddy, until it's accepted by guest. Before that, it cannot be
accessed by the first kernel as well as the kexec'ed kernel. The kexec'ed
kernel will skip these pages and fill in zero data for the reader of
vmcore.

The dump tool like makedumpfile creates a page descriptor (size 24 bytes)
for each non-free page, including zero data page, but it will not create
descriptor for free pages. If it is not able to distinguish these
unaccepted pages with zero data pages, a certain amount of space will be
wasted in proportion (~1/170). In fact, as a special kind of free page
the unaccepted pages should be excluded, like the real free pages.

Export the page type PAGE_UNACCEPTED_MAPCOUNT_VALUE to vmcoreinfo, so that
dump tool can identify whether a page is unaccepted.

[zhiquan1.li@intel.com: fix docs: "Title underline too short" warning]
Link: https://lore.kernel.org/all/20240809114854.3745464-5-kirill.shutemov@linux.intel.com/
Link: https://lkml.kernel.org/r/20250405060610.860465-1-zhiquan1.li@intel.com
Link: https://lore.kernel.org/all/20240809114854.3745464-5-kirill.shutemov@linux.intel.com/
Link: https://lkml.kernel.org/r/20250403030801.758687-1-zhiquan1.li@intel.com
Signed-off-by: Zhiquan Li <zhiquan1.li@intel.com>
Reviewed-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Acked-by: Baoquan He <bhe@redhat.com>
Cc: Dave Young <dyoung@redhat.com>
Cc: Vivek Goyal <vgoyal@redhat.com>
Cc: Zhiquan Li <zhiquan1.li@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Zhiquan Li and committed by
Andrew Morton
24702162 3330dc1b

+6 -2
+2 -2
Documentation/admin-guide/kdump/vmcoreinfo.rst
··· 331 331 Page attributes. These flags are used to filter various unnecessary for 332 332 dumping pages. 333 333 334 - PAGE_BUDDY_MAPCOUNT_VALUE(~PG_buddy)|PAGE_OFFLINE_MAPCOUNT_VALUE(~PG_offline) 335 - ----------------------------------------------------------------------------- 334 + PAGE_BUDDY_MAPCOUNT_VALUE(~PG_buddy)|PAGE_OFFLINE_MAPCOUNT_VALUE(~PG_offline)|PAGE_OFFLINE_MAPCOUNT_VALUE(~PG_unaccepted) 335 + ------------------------------------------------------------------------------------------------------------------------- 336 336 337 337 More page attributes. These flags are used to filter various unnecessary for 338 338 dumping pages.
+4
kernel/vmcore_info.c
··· 210 210 VMCOREINFO_NUMBER(PAGE_HUGETLB_MAPCOUNT_VALUE); 211 211 #define PAGE_OFFLINE_MAPCOUNT_VALUE (PGTY_offline << 24) 212 212 VMCOREINFO_NUMBER(PAGE_OFFLINE_MAPCOUNT_VALUE); 213 + #ifdef CONFIG_UNACCEPTED_MEMORY 214 + #define PAGE_UNACCEPTED_MAPCOUNT_VALUE (PGTY_unaccepted << 24) 215 + VMCOREINFO_NUMBER(PAGE_UNACCEPTED_MAPCOUNT_VALUE); 216 + #endif 213 217 214 218 #ifdef CONFIG_KALLSYMS 215 219 VMCOREINFO_SYMBOL(kallsyms_names);