Skip to contentSkip to conversation

Save PG_head_mask in VMCOREINFO

PATCH In review Petr Tesarik 2 participants 3 messages Apr 11, 2014 – Apr 22, 2014

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 include/linux/page-flags.h | 3 +++
 kernel/kexec.c             | 1 +
 2 files changed, 4 insertions(+)
include/linux/page-flags.h +0 -0
index d1fe1a7..bc2007e 100644
@@ -348,6 +348,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

kernel/kexec.c +1 -0
index c8380ad..e6f3aec 100644
@@ -1622,6 +1622,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();
Signature · 1 line
1.8.4.5
#1 lore raw
Quoted 5 lines · On Fri, 11 Apr 2014 17:50:39 +0200 Petr Tesarik <[email protected]> wrote:

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.

Quoted 7 lines

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.

Any opinion on this patch?

TIA,
Petr T

Quoted 34 lines

See https://lkml.org/lkml/2012/11/28/91 for the previous version.

---
 include/linux/page-flags.h | 3 +++
 kernel/kexec.c             | 1 +
 2 files changed, 4 insertions(+)
include/linux/page-flags.h +3 -0
index d1fe1a7..bc2007e 100644
@@ -348,6 +348,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
kernel/kexec.c +1 -0
index c8380ad..e6f3aec 100644
@@ -1622,6 +1622,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();
#2 lore raw
In reply to Petr Tesarik
Quoted 26 lines · Petr Tesarik

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.

---
 include/linux/page-flags.h | 3 +++
 kernel/kexec.c             | 1 +
 2 files changed, 4 insertions(+)
include/linux/page-flags.h +0 -0
index d1fe1a7..bc2007e 100644

include/linux/page-flags.h static inline void ClearPageCompound(struct page · line 352

Quoted 5 lines
include/linux/page-flags.h +2 -0
@@ -348,6 +348,9 @@ static inline void ClearPageCompound(struct page
 *page) ClearPageHead(page);
 }
 #endif
+
+#define PG_head_mask ((1L << PG_head))

Hi Petr,

I am fine with this trick which define one name PG_head_mask, but can stands for both PG_head and PG_compound.

I guess Eric may suggest the implementation like it done in mm/memory-failure.c . In that file it explicitly defines both of them.

Thanks
Baoquan

Quoted 23 lines
include/linux/page-flags.h +1 -0
+
 #else
 /*
  * Reduce page flag use as much as possible by overlapping
kernel/kexec.c +1 -0
index c8380ad..e6f3aec 100644
@@ -1622,6 +1622,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();
Signature · 6 lines
1.8.4.5

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec