diff options
author | Petr Tesarik <[email protected]> | 2014-06-23 13:22:03 -0700 |
---|---|---|
committer | Linus Torvalds <[email protected]> | 2014-06-23 16:47:43 -0700 |
commit | b3acc56bfe1287c6b666e80edc70b89eea2a1a80 (patch) | |
tree | 2ee8421399cda3bb043396d7f70aa9a2d86c9855 | |
parent | 8d056c48e486249e6487910b83e0f3be7c14acf7 (diff) |
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 <[email protected]>
Acked-by: Vivek Goyal <[email protected]>
Cc: Eric Biederman <[email protected]>
Cc: Paul Mackerras <[email protected]>
Cc: Fengguang Wu <[email protected]>
Cc: Benjamin Herrenschmidt <[email protected]>
Cc: Shaohua Li <[email protected]>
Cc: Alexey Kardashevskiy <[email protected]>
Cc: Sasha Levin <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
-rw-r--r-- | include/linux/page-flags.h | 3 | ||||
-rw-r--r-- | kernel/kexec.c | 1 |
2 files changed, 4 insertions, 0 deletions
diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h index 3c545b48aeab..8304959ad336 100644 --- a/include/linux/page-flags.h +++ b/include/linux/page-flags.h @@ -360,6 +360,9 @@ static inline void ClearPageCompound(struct page *page) ClearPageHead(page); } #endif + +#define PG_head_mask ((1L << PG_head)) + #else /* * Reduce page flag use as much as possible by overlapping diff --git a/kernel/kexec.c b/kernel/kexec.c index 6748688813d0..369f41a94124 100644 --- a/kernel/kexec.c +++ b/kernel/kexec.c @@ -1617,6 +1617,7 @@ static int __init crash_save_vmcoreinfo_init(void) #ifdef CONFIG_MEMORY_FAILURE VMCOREINFO_NUMBER(PG_hwpoison); #endif + VMCOREINFO_NUMBER(PG_head_mask); VMCOREINFO_NUMBER(PAGE_BUDDY_MAPCOUNT_VALUE); arch_crash_save_vmcoreinfo(); |