Skip to content

Commit b3acc56

Browse files
Petr Tesariktorvalds
authored andcommitted
kexec: save PG_head_mask in VMCOREINFO
To allow filtering of huge pages, makedumpfile must be able to identify them in the dump. This can be done by checking the appropriate page flag, so communicate its value to makedumpfile through the VMCOREINFO interface. There's only one small catch. Depending on how many page flags are available on a given architecture, this bit can be called PG_head or PG_compound. I sent a similar patch back in 2012, but Eric Biederman did not like using an #ifdef. So, this time I'm adding a common symbol (PG_head_mask) instead. See https://lkml.org/lkml/2012/11/28/91 for the previous version. Signed-off-by: Petr Tesarik <ptesarik@suse.cz> Acked-by: Vivek Goyal <vgoyal@redhat.com> Cc: Eric Biederman <ebiederm@xmission.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Fengguang Wu <fengguang.wu@intel.com> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Shaohua Li <shli@kernel.org> Cc: Alexey Kardashevskiy <aik@ozlabs.ru> Cc: Sasha Levin <sasha.levin@oracle.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 8d056c4 commit b3acc56

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

‎include/linux/page-flags.h‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -360,6 +360,9 @@ static inline void ClearPageCompound(struct page *page)
360360
ClearPageHead(page);
361361
}
362362
#endif
363+
364+
#define PG_head_mask ((1L << PG_head))
365+
363366
#else
364367
/*
365368
* Reduce page flag use as much as possible by overlapping

‎kernel/kexec.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1617,6 +1617,7 @@ static int __init crash_save_vmcoreinfo_init(void)
16171617
#ifdef CONFIG_MEMORY_FAILURE
16181618
VMCOREINFO_NUMBER(PG_hwpoison);
16191619
#endif
1620+
VMCOREINFO_NUMBER(PG_head_mask);
16201621
VMCOREINFO_NUMBER(PAGE_BUDDY_MAPCOUNT_VALUE);
16211622

16221623
arch_crash_save_vmcoreinfo();

0 commit comments

Comments
 (0)