From: Christian Borntraeger <hidden> Date: 2016-01-27 10:09:57
Andrew, since the arch patches depend on the base patch, maybe the mm
tree is the right one? I have acks/reviews for the s390/x86 part.
As CONFIG_DEBUG_PAGEALLOC can be enabled/disabled via kernel
parameters we can optimize some cases by checking the enablement
state.
I have done s390 and x86 as examples.
s390 should be ok, I tested several combinations, x86 seems to
work as well.
Power can probably do the same, Michael/Ben?
I am not sure about sparc. Sparc seems to allocate the TSB buffer
really early. David?
V2->V3:
- Fix whitespace/indent breakage in s390 patch
V1->V2:
- replace DEBUG_PAGEALLOC(disabled/enabled) with DEBUG_PAGEALLOC
dump_stack for s390/x86
- add /* CONFIG_DEBUG_PAGEALLOC */ to else and endif
Christian Borntraeger (3):
mm: provide debug_pagealloc_enabled() without CONFIG_DEBUG_PAGEALLOC
x86: query dynamic DEBUG_PAGEALLOC setting
s390: query dynamic DEBUG_PAGEALLOC setting
arch/s390/kernel/dumpstack.c | 6 +++---
arch/s390/mm/vmem.c | 10 ++++------
arch/x86/kernel/dumpstack.c | 5 ++---
arch/x86/mm/init.c | 7 ++++---
arch/x86/mm/pageattr.c | 14 ++++----------
include/linux/mm.h | 9 +++++++--
6 files changed, 24 insertions(+), 27 deletions(-)
--
2.3.0
From: Christian Borntraeger <hidden> Date: 2016-01-27 10:09:54
We can use debug_pagealloc_enabled() to check if we can map
the identity mapping with 1MB/2GB pages as well as to print
the current setting in dump_stack.
Signed-off-by: Christian Borntraeger <redacted>
Reviewed-by: Heiko Carstens <redacted>
---
arch/s390/kernel/dumpstack.c | 6 +++---
arch/s390/mm/vmem.c | 10 ++++------
2 files changed, 7 insertions(+), 9 deletions(-)
@@ -94,16 +94,15 @@ static int vmem_add_mem(unsigned long start, unsigned long size, int ro)pgd_populate(&init_mm,pg_dir,pu_dir);}pu_dir=pud_offset(pg_dir,address);-#ifndef CONFIG_DEBUG_PAGEALLOCif(MACHINE_HAS_EDAT2&&pud_none(*pu_dir)&&address&&-!(address&~PUD_MASK)&&(address+PUD_SIZE<=end)){+!(address&~PUD_MASK)&&(address+PUD_SIZE<=end)&&+!debug_pagealloc_enabled()){pud_val(*pu_dir)=__pa(address)|_REGION_ENTRY_TYPE_R3|_REGION3_ENTRY_LARGE|(ro?_REGION_ENTRY_PROTECT:0);address+=PUD_SIZE;continue;}-#endifif(pud_none(*pu_dir)){pm_dir=vmem_pmd_alloc();if(!pm_dir)
@@ -111,9 +110,9 @@ static int vmem_add_mem(unsigned long start, unsigned long size, int ro)pud_populate(&init_mm,pu_dir,pm_dir);}pm_dir=pmd_offset(pu_dir,address);-#ifndef CONFIG_DEBUG_PAGEALLOCif(MACHINE_HAS_EDAT1&&pmd_none(*pm_dir)&&address&&-!(address&~PMD_MASK)&&(address+PMD_SIZE<=end)){+!(address&~PMD_MASK)&&(address+PMD_SIZE<=end)&&+!debug_pagealloc_enabled()){pmd_val(*pm_dir)=__pa(address)|_SEGMENT_ENTRY|_SEGMENT_ENTRY_LARGE|_SEGMENT_ENTRY_YOUNG|
@@ -121,7 +120,6 @@ static int vmem_add_mem(unsigned long start, unsigned long size, int ro)address+=PMD_SIZE;continue;}-#endifif(pmd_none(*pm_dir)){pt_dir=vmem_pte_alloc(address);if(!pt_dir)
From: Christian Borntraeger <hidden> Date: 2016-01-27 10:11:02
We can use debug_pagealloc_enabled() to check if we can map
the identity mapping with 2MB pages. We can also add the state
into the dump_stack output.
The patch does not touch the code for the 1GB pages, which ignored
CONFIG_DEBUG_PAGEALLOC. Do we need to fence this as well?
Signed-off-by: Christian Borntraeger <redacted>
Reviewed-by: Thomas Gleixner <redacted>
---
arch/x86/kernel/dumpstack.c | 5 ++---
arch/x86/mm/init.c | 7 ++++---
arch/x86/mm/pageattr.c | 14 ++++----------
3 files changed, 10 insertions(+), 16 deletions(-)
From: Christian Borntraeger <hidden> Date: 2016-01-27 10:11:12
We can provide debug_pagealloc_enabled() also if CONFIG_DEBUG_PAGEALLOC
is not set. It will return false in that case.
Signed-off-by: Christian Borntraeger <redacted>
Acked-by: David Rientjes <rientjes@google.com>
Acked-by: Thomas Gleixner <redacted>
---
include/linux/mm.h | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
From: David Rientjes <rientjes@google.com> Date: 2016-01-27 22:17:17
On Wed, 27 Jan 2016, Christian Borntraeger wrote:
quoted hunk
We can use debug_pagealloc_enabled() to check if we can map
the identity mapping with 2MB pages. We can also add the state
into the dump_stack output.
The patch does not touch the code for the 1GB pages, which ignored
CONFIG_DEBUG_PAGEALLOC. Do we need to fence this as well?
Signed-off-by: Christian Borntraeger <redacted>
Reviewed-by: Thomas Gleixner <redacted>
---
arch/x86/kernel/dumpstack.c | 5 ++---
arch/x86/mm/init.c | 7 ++++---
arch/x86/mm/pageattr.c | 14 ++++----------
3 files changed, 10 insertions(+), 16 deletions(-)
From: David Rientjes <rientjes@google.com> Date: 2016-01-27 22:18:37
On Wed, 27 Jan 2016, Christian Borntraeger wrote:
We can use debug_pagealloc_enabled() to check if we can map
the identity mapping with 1MB/2GB pages as well as to print
the current setting in dump_stack.
Signed-off-by: Christian Borntraeger <redacted>
Reviewed-by: Heiko Carstens <redacted>
From: Christian Borntraeger <hidden> Date: 2016-01-28 09:48:23
On 01/27/2016 11:17 PM, David Rientjes wrote:
On Wed, 27 Jan 2016, Christian Borntraeger wrote:
quoted
We can use debug_pagealloc_enabled() to check if we can map
the identity mapping with 2MB pages. We can also add the state
into the dump_stack output.
The patch does not touch the code for the 1GB pages, which ignored
CONFIG_DEBUG_PAGEALLOC. Do we need to fence this as well?
Signed-off-by: Christian Borntraeger <redacted>
Reviewed-by: Thomas Gleixner <redacted>
---
arch/x86/kernel/dumpstack.c | 5 ++---
arch/x86/mm/init.c | 7 ++++---
arch/x86/mm/pageattr.c | 14 ++++----------
3 files changed, 10 insertions(+), 16 deletions(-)
I would have thought free_init_pages() would be modified to use
debug_pagealloc_enabled() as well?
Indeed, I only touched the identity mapping and dump stack.
The question is do we really want to change free_init_pages as well?
The unmapping during runtime causes significant overhead, but the
unmapping after init imposes almost no runtime overhead. Of course,
things get fishy now as what is enabled and what not.
Kconfig after my patch "mm/debug_pagealloc: Ask users for default setting of debug_pagealloc"
(in mm) now states
----snip----
By default this option will have a small overhead, e.g. by not
allowing the kernel mapping to be backed by large pages on some
architectures. Even bigger overhead comes when the debugging is
enabled by DEBUG_PAGEALLOC_ENABLE_DEFAULT or the debug_pagealloc
command line parameter.
----snip----
So I am tempted to NOT change free_init_pages, but the x86 maintainers
can certainly decide differently. Ingo, Thomas, H. Peter, please advise.
From: David Rientjes <rientjes@google.com> Date: 2016-01-28 23:03:45
On Thu, 28 Jan 2016, Christian Borntraeger wrote:
Indeed, I only touched the identity mapping and dump stack.
The question is do we really want to change free_init_pages as well?
The unmapping during runtime causes significant overhead, but the
unmapping after init imposes almost no runtime overhead. Of course,
things get fishy now as what is enabled and what not.
Kconfig after my patch "mm/debug_pagealloc: Ask users for default setting of debug_pagealloc"
(in mm) now states
----snip----
By default this option will have a small overhead, e.g. by not
allowing the kernel mapping to be backed by large pages on some
architectures. Even bigger overhead comes when the debugging is
enabled by DEBUG_PAGEALLOC_ENABLE_DEFAULT or the debug_pagealloc
command line parameter.
----snip----
So I am tempted to NOT change free_init_pages, but the x86 maintainers
can certainly decide differently. Ingo, Thomas, H. Peter, please advise.
I'm sorry, but I thought the discussion of the previous version of the
patchset led to deciding that all CONFIG_DEBUG_PAGEALLOC behavior would be
controlled by being enabled on the commandline and checked with
debug_pagealloc_enabled().
I don't think we should have a CONFIG_DEBUG_PAGEALLOC that does some stuff
and then a commandline parameter or CONFIG_DEBUG_PAGEALLOC_ENABLE_DEFAULT
to enable more stuff. It should either be all enabled by the commandline
(or config option) or split into a separate entity.
CONFIG_DEBUG_PAGEALLOC_LIGHT and CONFIG_DEBUG_PAGEALLOC would be fine, but
the current state is very confusing about what is being done and what
isn't.
It also wouldn't hurt to enumerate what is enabled and what isn't enabled
in the Kconfig entry.
From: David Rientjes <rientjes@google.com> Date: 2016-02-02 21:51:40
On Thu, 28 Jan 2016, David Rientjes wrote:
On Thu, 28 Jan 2016, Christian Borntraeger wrote:
quoted
Indeed, I only touched the identity mapping and dump stack.
The question is do we really want to change free_init_pages as well?
The unmapping during runtime causes significant overhead, but the
unmapping after init imposes almost no runtime overhead. Of course,
things get fishy now as what is enabled and what not.
Kconfig after my patch "mm/debug_pagealloc: Ask users for default setting of debug_pagealloc"
(in mm) now states
----snip----
By default this option will have a small overhead, e.g. by not
allowing the kernel mapping to be backed by large pages on some
architectures. Even bigger overhead comes when the debugging is
enabled by DEBUG_PAGEALLOC_ENABLE_DEFAULT or the debug_pagealloc
command line parameter.
----snip----
So I am tempted to NOT change free_init_pages, but the x86 maintainers
can certainly decide differently. Ingo, Thomas, H. Peter, please advise.
I'm sorry, but I thought the discussion of the previous version of the
patchset led to deciding that all CONFIG_DEBUG_PAGEALLOC behavior would be
controlled by being enabled on the commandline and checked with
debug_pagealloc_enabled().
I don't think we should have a CONFIG_DEBUG_PAGEALLOC that does some stuff
and then a commandline parameter or CONFIG_DEBUG_PAGEALLOC_ENABLE_DEFAULT
to enable more stuff. It should either be all enabled by the commandline
(or config option) or split into a separate entity.
CONFIG_DEBUG_PAGEALLOC_LIGHT and CONFIG_DEBUG_PAGEALLOC would be fine, but
the current state is very confusing about what is being done and what
isn't.
From: Christian Borntraeger <hidden> Date: 2016-02-02 21:53:52
On 02/02/2016 10:51 PM, David Rientjes wrote:
On Thu, 28 Jan 2016, David Rientjes wrote:
quoted
On Thu, 28 Jan 2016, Christian Borntraeger wrote:
quoted
Indeed, I only touched the identity mapping and dump stack.
The question is do we really want to change free_init_pages as well?
The unmapping during runtime causes significant overhead, but the
unmapping after init imposes almost no runtime overhead. Of course,
things get fishy now as what is enabled and what not.
Kconfig after my patch "mm/debug_pagealloc: Ask users for default setting of debug_pagealloc"
(in mm) now states
----snip----
By default this option will have a small overhead, e.g. by not
allowing the kernel mapping to be backed by large pages on some
architectures. Even bigger overhead comes when the debugging is
enabled by DEBUG_PAGEALLOC_ENABLE_DEFAULT or the debug_pagealloc
command line parameter.
----snip----
So I am tempted to NOT change free_init_pages, but the x86 maintainers
can certainly decide differently. Ingo, Thomas, H. Peter, please advise.
I'm sorry, but I thought the discussion of the previous version of the
patchset led to deciding that all CONFIG_DEBUG_PAGEALLOC behavior would be
controlled by being enabled on the commandline and checked with
debug_pagealloc_enabled().
I don't think we should have a CONFIG_DEBUG_PAGEALLOC that does some stuff
and then a commandline parameter or CONFIG_DEBUG_PAGEALLOC_ENABLE_DEFAULT
to enable more stuff. It should either be all enabled by the commandline
(or config option) or split into a separate entity.
CONFIG_DEBUG_PAGEALLOC_LIGHT and CONFIG_DEBUG_PAGEALLOC would be fine, but
the current state is very confusing about what is being done and what
isn't.
From: Andrew Morton <akpm@linux-foundation.org> Date: 2016-02-02 22:22:01
On Tue, 2 Feb 2016 22:53:36 +0100 Christian Borntraeger [off-list ref] wrote:
quoted
quoted
I don't think we should have a CONFIG_DEBUG_PAGEALLOC that does some stuff
and then a commandline parameter or CONFIG_DEBUG_PAGEALLOC_ENABLE_DEFAULT
to enable more stuff. It should either be all enabled by the commandline
(or config option) or split into a separate entity.
CONFIG_DEBUG_PAGEALLOC_LIGHT and CONFIG_DEBUG_PAGEALLOC would be fine, but
the current state is very confusing about what is being done and what
isn't.
From: Christian Borntraeger <hidden> Date: 2016-02-02 22:38:02
On 02/02/2016 11:21 PM, Andrew Morton wrote:
On Tue, 2 Feb 2016 22:53:36 +0100 Christian Borntraeger [off-list ref] wrote:
quoted
quoted
quoted
I don't think we should have a CONFIG_DEBUG_PAGEALLOC that does some stuff
and then a commandline parameter or CONFIG_DEBUG_PAGEALLOC_ENABLE_DEFAULT
to enable more stuff. It should either be all enabled by the commandline
(or config option) or split into a separate entity.
CONFIG_DEBUG_PAGEALLOC_LIGHT and CONFIG_DEBUG_PAGEALLOC would be fine, but
the current state is very confusing about what is being done and what
isn't.
From: Andrew Morton <akpm@linux-foundation.org> Date: 2016-02-02 23:04:40
On Tue, 2 Feb 2016 23:37:50 +0100 Christian Borntraeger [off-list ref] wrote:
On 02/02/2016 11:21 PM, Andrew Morton wrote:
quoted
On Tue, 2 Feb 2016 22:53:36 +0100 Christian Borntraeger [off-list ref] wrote:
quoted
quoted
quoted
I don't think we should have a CONFIG_DEBUG_PAGEALLOC that does some stuff
and then a commandline parameter or CONFIG_DEBUG_PAGEALLOC_ENABLE_DEFAULT
to enable more stuff. It should either be all enabled by the commandline
(or config option) or split into a separate entity.
CONFIG_DEBUG_PAGEALLOC_LIGHT and CONFIG_DEBUG_PAGEALLOC would be fine, but
the current state is very confusing about what is being done and what
isn't.
That's already in linux-next so I can't apply it.
Well, I can, but it's a hassle. What's happening here?
I pushed it on my tree for kbuild testing purposes some days ago.
Will drop so that it can go via mm.
There are other patches that I haven't merged because they were already
in -next. In fact I think I dropped them because they later popped up
in -next.
Some or all of:
lib-spinlock_debugc-prevent-an-infinite-recursive-cycle-in-spin_dump.patch
mm-provide-debug_pagealloc_enabled-without-config_debug_pagealloc.patch
x86-query-dynamic-debug_pagealloc-setting.patch
s390-query-dynamic-debug_pagealloc-setting.patch
mm-provide-debug_pagealloc_enabled-without-config_debug_pagealloc.patch
x86-query-dynamic-debug_pagealloc-setting.patch
s390-query-dynamic-debug_pagealloc-setting.patch
So please resend everything which you think is needed.
From: Stephen Rothwell <hidden> Date: 2016-02-03 00:13:12
Hi Andrew,
On Tue, 2 Feb 2016 15:04:35 -0800 Andrew Morton [off-list ref] wrote:
On Tue, 2 Feb 2016 23:37:50 +0100 Christian Borntraeger [off-list ref] wrote:
quoted
I pushed it on my tree for kbuild testing purposes some days ago.
Will drop so that it can go via mm.
There are other patches that I haven't merged because they were already
in -next. In fact I think I dropped them because they later popped up
in -next.
Some or all of:
lib-spinlock_debugc-prevent-an-infinite-recursive-cycle-in-spin_dump.patch
mm-provide-debug_pagealloc_enabled-without-config_debug_pagealloc.patch
x86-query-dynamic-debug_pagealloc-setting.patch
s390-query-dynamic-debug_pagealloc-setting.patch
mm-provide-debug_pagealloc_enabled-without-config_debug_pagealloc.patch
x86-query-dynamic-debug_pagealloc-setting.patch
s390-query-dynamic-debug_pagealloc-setting.patch
So please resend everything which you think is needed.
Christian's tree will be empty in today's linux-next (I just refetched it).
--
Cheers,
Stephen Rothwell