All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Save PG_head_mask in VMCOREINFO
@ 2014-04-11 15:50 ` Petr Tesarik
  0 siblings, 0 replies; 6+ messages in thread
From: Petr Tesarik @ 2014-04-11 15:50 UTC (permalink / raw)
  To: Eric Biederman, Andrew Morton, Paul Mackerras, Fengguang Wu,
	Benjamin Herrenschmidt, Shaohua Li, Alexey Kardashevskiy,
	Sasha Levin
  Cc: linux-kernel, kexec

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>
---
 include/linux/page-flags.h | 3 +++
 kernel/kexec.c             | 1 +
 2 files changed, 4 insertions(+)

diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h
index d1fe1a7..bc2007e 100644
--- a/include/linux/page-flags.h
+++ b/include/linux/page-flags.h
@@ -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
diff --git a/kernel/kexec.c b/kernel/kexec.c
index c8380ad..e6f3aec 100644
--- a/kernel/kexec.c
+++ b/kernel/kexec.c
@@ -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();
-- 
1.8.4.5

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH] Save PG_head_mask in VMCOREINFO
@ 2014-04-11 15:50 ` Petr Tesarik
  0 siblings, 0 replies; 6+ messages in thread
From: Petr Tesarik @ 2014-04-11 15:50 UTC (permalink / raw)
  To: Eric Biederman, Andrew Morton, Paul Mackerras, Fengguang Wu,
	Benjamin Herrenschmidt, Shaohua Li, Alexey Kardashevskiy,
	Sasha Levin
  Cc: kexec, linux-kernel

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>
---
 include/linux/page-flags.h | 3 +++
 kernel/kexec.c             | 1 +
 2 files changed, 4 insertions(+)

diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h
index d1fe1a7..bc2007e 100644
--- a/include/linux/page-flags.h
+++ b/include/linux/page-flags.h
@@ -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
diff --git a/kernel/kexec.c b/kernel/kexec.c
index c8380ad..e6f3aec 100644
--- a/kernel/kexec.c
+++ b/kernel/kexec.c
@@ -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();
-- 
1.8.4.5

_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] Save PG_head_mask in VMCOREINFO
  2014-04-11 15:50 ` Petr Tesarik
@ 2014-04-15  9:02   ` Petr Tesarik
  -1 siblings, 0 replies; 6+ messages in thread
From: Petr Tesarik @ 2014-04-15  9:02 UTC (permalink / raw)
  To: Petr Tesarik
  Cc: Eric Biederman, Andrew Morton, Paul Mackerras, Fengguang Wu,
	Benjamin Herrenschmidt, Shaohua Li, Alexey Kardashevskiy,
	Sasha Levin, kexec, linux-kernel

On Fri, 11 Apr 2014 17:50:39 +0200
Petr Tesarik <ptesarik@suse.cz> 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.
> 
> 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

> See https://lkml.org/lkml/2012/11/28/91 for the previous version.
> 
> Signed-off-by: Petr Tesarik <ptesarik@suse.cz>
> ---
>  include/linux/page-flags.h | 3 +++
>  kernel/kexec.c             | 1 +
>  2 files changed, 4 insertions(+)
> 
> diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h
> index d1fe1a7..bc2007e 100644
> --- a/include/linux/page-flags.h
> +++ b/include/linux/page-flags.h
> @@ -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
> diff --git a/kernel/kexec.c b/kernel/kexec.c
> index c8380ad..e6f3aec 100644
> --- a/kernel/kexec.c
> +++ b/kernel/kexec.c
> @@ -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();


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] Save PG_head_mask in VMCOREINFO
@ 2014-04-15  9:02   ` Petr Tesarik
  0 siblings, 0 replies; 6+ messages in thread
From: Petr Tesarik @ 2014-04-15  9:02 UTC (permalink / raw)
  To: Petr Tesarik
  Cc: Alexey Kardashevskiy, Benjamin Herrenschmidt, kexec,
	linux-kernel, Paul Mackerras, Eric Biederman, Sasha Levin,
	Andrew Morton, Fengguang Wu, Shaohua Li

On Fri, 11 Apr 2014 17:50:39 +0200
Petr Tesarik <ptesarik@suse.cz> 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.
> 
> 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

> See https://lkml.org/lkml/2012/11/28/91 for the previous version.
> 
> Signed-off-by: Petr Tesarik <ptesarik@suse.cz>
> ---
>  include/linux/page-flags.h | 3 +++
>  kernel/kexec.c             | 1 +
>  2 files changed, 4 insertions(+)
> 
> diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h
> index d1fe1a7..bc2007e 100644
> --- a/include/linux/page-flags.h
> +++ b/include/linux/page-flags.h
> @@ -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
> diff --git a/kernel/kexec.c b/kernel/kexec.c
> index c8380ad..e6f3aec 100644
> --- a/kernel/kexec.c
> +++ b/kernel/kexec.c
> @@ -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();


_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] Save PG_head_mask in VMCOREINFO
  2014-04-11 15:50 ` Petr Tesarik
@ 2014-04-22  3:01   ` Baoquan He
  -1 siblings, 0 replies; 6+ messages in thread
From: Baoquan He @ 2014-04-22  3:01 UTC (permalink / raw)
  To: Petr Tesarik
  Cc: Eric Biederman, Andrew Morton, Paul Mackerras, Fengguang Wu,
	Benjamin Herrenschmidt, Shaohua Li, Alexey Kardashevskiy,
	Sasha Levin, kexec, linux-kernel

On 04/11/14 at 05:50pm, Petr Tesarik 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.
> 
> 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>
> ---
>  include/linux/page-flags.h | 3 +++
>  kernel/kexec.c             | 1 +
>  2 files changed, 4 insertions(+)
> 
> diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h
> index d1fe1a7..bc2007e 100644
> --- a/include/linux/page-flags.h
> +++ b/include/linux/page-flags.h
> @@ -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

> +
>  #else
>  /*
>   * Reduce page flag use as much as possible by overlapping
> diff --git a/kernel/kexec.c b/kernel/kexec.c
> index c8380ad..e6f3aec 100644
> --- a/kernel/kexec.c
> +++ b/kernel/kexec.c
> @@ -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();
> -- 
> 1.8.4.5
> 
> _______________________________________________
> kexec mailing list
> kexec@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] Save PG_head_mask in VMCOREINFO
@ 2014-04-22  3:01   ` Baoquan He
  0 siblings, 0 replies; 6+ messages in thread
From: Baoquan He @ 2014-04-22  3:01 UTC (permalink / raw)
  To: Petr Tesarik
  Cc: Alexey Kardashevskiy, Benjamin Herrenschmidt, kexec,
	linux-kernel, Paul Mackerras, Eric Biederman, Sasha Levin,
	Andrew Morton, Fengguang Wu, Shaohua Li

On 04/11/14 at 05:50pm, Petr Tesarik 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.
> 
> 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>
> ---
>  include/linux/page-flags.h | 3 +++
>  kernel/kexec.c             | 1 +
>  2 files changed, 4 insertions(+)
> 
> diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h
> index d1fe1a7..bc2007e 100644
> --- a/include/linux/page-flags.h
> +++ b/include/linux/page-flags.h
> @@ -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

> +
>  #else
>  /*
>   * Reduce page flag use as much as possible by overlapping
> diff --git a/kernel/kexec.c b/kernel/kexec.c
> index c8380ad..e6f3aec 100644
> --- a/kernel/kexec.c
> +++ b/kernel/kexec.c
> @@ -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();
> -- 
> 1.8.4.5
> 
> _______________________________________________
> kexec mailing list
> kexec@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/kexec

_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-04-22  3:04 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-11 15:50 [PATCH] Save PG_head_mask in VMCOREINFO Petr Tesarik
2014-04-11 15:50 ` Petr Tesarik
2014-04-15  9:02 ` Petr Tesarik
2014-04-15  9:02   ` Petr Tesarik
2014-04-22  3:01 ` Baoquan He
2014-04-22  3:01   ` Baoquan He

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.