* [PATCH v3 0/3] Optimize CONFIG_DEBUG_PAGEALLOC
@ 2016-01-27 10:09 Christian Borntraeger
2016-01-27 10:09 ` [PATCH v3 1/3] mm: provide debug_pagealloc_enabled() without CONFIG_DEBUG_PAGEALLOC Christian Borntraeger
` (2 more replies)
0 siblings, 3 replies; 19+ messages in thread
From: Christian Borntraeger @ 2016-01-27 10:09 UTC (permalink / raw)
To: akpm
Cc: linux-kernel, linux-mm, linux-arch, linux-s390, x86, linuxppc-dev,
davem, Joonsoo Kim, davej, Christian Borntraeger
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
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 19+ messages in thread* [PATCH v3 1/3] mm: provide debug_pagealloc_enabled() without CONFIG_DEBUG_PAGEALLOC
2016-01-27 10:09 [PATCH v3 0/3] Optimize CONFIG_DEBUG_PAGEALLOC Christian Borntraeger
@ 2016-01-27 10:09 ` Christian Borntraeger
2016-01-27 10:10 ` [PATCH v3 2/3] x86: query dynamic DEBUG_PAGEALLOC setting Christian Borntraeger
2016-01-27 10:10 ` [PATCH v3 3/3] s390: query dynamic DEBUG_PAGEALLOC setting Christian Borntraeger
2 siblings, 0 replies; 19+ messages in thread
From: Christian Borntraeger @ 2016-01-27 10:09 UTC (permalink / raw)
To: akpm
Cc: linux-kernel, linux-mm, linux-arch, linux-s390, x86, linuxppc-dev,
davem, Joonsoo Kim, davej, Christian Borntraeger
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 <borntraeger@de.ibm.com>
Acked-by: David Rientjes <rientjes@google.com>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
---
include/linux/mm.h | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/include/linux/mm.h b/include/linux/mm.h
index f1cd22f..ae84716 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -2194,13 +2194,18 @@ kernel_map_pages(struct page *page, int numpages, int enable)
#ifdef CONFIG_HIBERNATION
extern bool kernel_page_present(struct page *page);
#endif /* CONFIG_HIBERNATION */
-#else
+#else /* CONFIG_DEBUG_PAGEALLOC */
+static inline bool debug_pagealloc_enabled(void)
+{
+ return false;
+}
+
static inline void
kernel_map_pages(struct page *page, int numpages, int enable) {}
#ifdef CONFIG_HIBERNATION
static inline bool kernel_page_present(struct page *page) { return true; }
#endif /* CONFIG_HIBERNATION */
-#endif
+#endif /* CONFIG_DEBUG_PAGEALLOC */
#ifdef __HAVE_ARCH_GATE_AREA
extern struct vm_area_struct *get_gate_vma(struct mm_struct *mm);
--
2.3.0
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply related [flat|nested] 19+ messages in thread* [PATCH v3 2/3] x86: query dynamic DEBUG_PAGEALLOC setting
2016-01-27 10:09 [PATCH v3 0/3] Optimize CONFIG_DEBUG_PAGEALLOC Christian Borntraeger
2016-01-27 10:09 ` [PATCH v3 1/3] mm: provide debug_pagealloc_enabled() without CONFIG_DEBUG_PAGEALLOC Christian Borntraeger
@ 2016-01-27 10:10 ` Christian Borntraeger
2016-01-27 22:17 ` David Rientjes
2016-01-27 22:18 ` (unknown) David Rientjes via Linuxppc-dev
2016-01-27 10:10 ` [PATCH v3 3/3] s390: query dynamic DEBUG_PAGEALLOC setting Christian Borntraeger
2 siblings, 2 replies; 19+ messages in thread
From: Christian Borntraeger @ 2016-01-27 10:10 UTC (permalink / raw)
To: akpm
Cc: linux-kernel, linux-mm, linux-arch, linux-s390, x86, linuxppc-dev,
davem, Joonsoo Kim, davej, Christian Borntraeger
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 <borntraeger@de.ibm.com>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
---
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(-)
diff --git a/arch/x86/kernel/dumpstack.c b/arch/x86/kernel/dumpstack.c
index 9c30acf..32e5699 100644
--- a/arch/x86/kernel/dumpstack.c
+++ b/arch/x86/kernel/dumpstack.c
@@ -265,9 +265,8 @@ int __die(const char *str, struct pt_regs *regs, long err)
#ifdef CONFIG_SMP
printk("SMP ");
#endif
-#ifdef CONFIG_DEBUG_PAGEALLOC
- printk("DEBUG_PAGEALLOC ");
-#endif
+ if (debug_pagealloc_enabled())
+ printk("DEBUG_PAGEALLOC ");
#ifdef CONFIG_KASAN
printk("KASAN");
#endif
diff --git a/arch/x86/mm/init.c b/arch/x86/mm/init.c
index 493f541..39823fd 100644
--- a/arch/x86/mm/init.c
+++ b/arch/x86/mm/init.c
@@ -150,13 +150,14 @@ static int page_size_mask;
static void __init probe_page_size_mask(void)
{
-#if !defined(CONFIG_DEBUG_PAGEALLOC) && !defined(CONFIG_KMEMCHECK)
+#if !defined(CONFIG_KMEMCHECK)
/*
- * For CONFIG_DEBUG_PAGEALLOC, identity mapping will use small pages.
+ * For CONFIG_KMEMCHECK or pagealloc debugging, identity mapping will
+ * use small pages.
* This will simplify cpa(), which otherwise needs to support splitting
* large pages into small in interrupt context, etc.
*/
- if (cpu_has_pse)
+ if (cpu_has_pse && !debug_pagealloc_enabled())
page_size_mask |= 1 << PG_LEVEL_2M;
#endif
diff --git a/arch/x86/mm/pageattr.c b/arch/x86/mm/pageattr.c
index fc6a4c8..5f68987 100644
--- a/arch/x86/mm/pageattr.c
+++ b/arch/x86/mm/pageattr.c
@@ -106,12 +106,6 @@ static inline unsigned long highmap_end_pfn(void)
#endif
-#ifdef CONFIG_DEBUG_PAGEALLOC
-# define debug_pagealloc 1
-#else
-# define debug_pagealloc 0
-#endif
-
static inline int
within(unsigned long addr, unsigned long start, unsigned long end)
{
@@ -708,10 +702,10 @@ static int split_large_page(struct cpa_data *cpa, pte_t *kpte,
{
struct page *base;
- if (!debug_pagealloc)
+ if (!debug_pagealloc_enabled())
spin_unlock(&cpa_lock);
base = alloc_pages(GFP_KERNEL | __GFP_NOTRACK, 0);
- if (!debug_pagealloc)
+ if (!debug_pagealloc_enabled())
spin_lock(&cpa_lock);
if (!base)
return -ENOMEM;
@@ -1331,10 +1325,10 @@ static int __change_page_attr_set_clr(struct cpa_data *cpa, int checkalias)
if (cpa->flags & (CPA_ARRAY | CPA_PAGES_ARRAY))
cpa->numpages = 1;
- if (!debug_pagealloc)
+ if (!debug_pagealloc_enabled())
spin_lock(&cpa_lock);
ret = __change_page_attr(cpa, checkalias);
- if (!debug_pagealloc)
+ if (!debug_pagealloc_enabled())
spin_unlock(&cpa_lock);
if (ret)
return ret;
--
2.3.0
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply related [flat|nested] 19+ messages in thread* Re: [PATCH v3 2/3] x86: query dynamic DEBUG_PAGEALLOC setting
2016-01-27 10:10 ` [PATCH v3 2/3] x86: query dynamic DEBUG_PAGEALLOC setting Christian Borntraeger
@ 2016-01-27 22:17 ` David Rientjes
2016-01-28 9:48 ` Christian Borntraeger
2016-01-27 22:18 ` (unknown) David Rientjes via Linuxppc-dev
1 sibling, 1 reply; 19+ messages in thread
From: David Rientjes @ 2016-01-27 22:17 UTC (permalink / raw)
To: Christian Borntraeger
Cc: akpm, linux-kernel, linux-mm, linux-arch, linux-s390, x86,
linuxppc-dev, davem, Joonsoo Kim, davej
On Wed, 27 Jan 2016, Christian Borntraeger wrote:
> 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 <borntraeger@de.ibm.com>
> Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
> ---
> 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(-)
>
> diff --git a/arch/x86/kernel/dumpstack.c b/arch/x86/kernel/dumpstack.c
> index 9c30acf..32e5699 100644
> --- a/arch/x86/kernel/dumpstack.c
> +++ b/arch/x86/kernel/dumpstack.c
> @@ -265,9 +265,8 @@ int __die(const char *str, struct pt_regs *regs, long err)
> #ifdef CONFIG_SMP
> printk("SMP ");
> #endif
> -#ifdef CONFIG_DEBUG_PAGEALLOC
> - printk("DEBUG_PAGEALLOC ");
> -#endif
> + if (debug_pagealloc_enabled())
> + printk("DEBUG_PAGEALLOC ");
> #ifdef CONFIG_KASAN
> printk("KASAN");
> #endif
> diff --git a/arch/x86/mm/init.c b/arch/x86/mm/init.c
> index 493f541..39823fd 100644
> --- a/arch/x86/mm/init.c
> +++ b/arch/x86/mm/init.c
> @@ -150,13 +150,14 @@ static int page_size_mask;
>
> static void __init probe_page_size_mask(void)
> {
> -#if !defined(CONFIG_DEBUG_PAGEALLOC) && !defined(CONFIG_KMEMCHECK)
> +#if !defined(CONFIG_KMEMCHECK)
> /*
> - * For CONFIG_DEBUG_PAGEALLOC, identity mapping will use small pages.
> + * For CONFIG_KMEMCHECK or pagealloc debugging, identity mapping will
> + * use small pages.
> * This will simplify cpa(), which otherwise needs to support splitting
> * large pages into small in interrupt context, etc.
> */
> - if (cpu_has_pse)
> + if (cpu_has_pse && !debug_pagealloc_enabled())
> page_size_mask |= 1 << PG_LEVEL_2M;
> #endif
>
I would have thought free_init_pages() would be modified to use
debug_pagealloc_enabled() as well?
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 19+ messages in thread* Re: [PATCH v3 2/3] x86: query dynamic DEBUG_PAGEALLOC setting
2016-01-27 22:17 ` David Rientjes
@ 2016-01-28 9:48 ` Christian Borntraeger
2016-01-28 23:03 ` David Rientjes
2016-01-28 23:04 ` (unknown) David Rientjes via Linuxppc-dev
0 siblings, 2 replies; 19+ messages in thread
From: Christian Borntraeger @ 2016-01-28 9:48 UTC (permalink / raw)
To: David Rientjes
Cc: akpm, linux-kernel, linux-mm, linux-arch, linux-s390, x86,
linuxppc-dev, davem, Joonsoo Kim, davej
On 01/27/2016 11:17 PM, David Rientjes wrote:
> On Wed, 27 Jan 2016, Christian Borntraeger wrote:
>
>> 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 <borntraeger@de.ibm.com>
>> Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
>> ---
>> 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(-)
>>
>> diff --git a/arch/x86/kernel/dumpstack.c b/arch/x86/kernel/dumpstack.c
>> index 9c30acf..32e5699 100644
>> --- a/arch/x86/kernel/dumpstack.c
>> +++ b/arch/x86/kernel/dumpstack.c
>> @@ -265,9 +265,8 @@ int __die(const char *str, struct pt_regs *regs, long err)
>> #ifdef CONFIG_SMP
>> printk("SMP ");
>> #endif
>> -#ifdef CONFIG_DEBUG_PAGEALLOC
>> - printk("DEBUG_PAGEALLOC ");
>> -#endif
>> + if (debug_pagealloc_enabled())
>> + printk("DEBUG_PAGEALLOC ");
>> #ifdef CONFIG_KASAN
>> printk("KASAN");
>> #endif
>> diff --git a/arch/x86/mm/init.c b/arch/x86/mm/init.c
>> index 493f541..39823fd 100644
>> --- a/arch/x86/mm/init.c
>> +++ b/arch/x86/mm/init.c
>> @@ -150,13 +150,14 @@ static int page_size_mask;
>>
>> static void __init probe_page_size_mask(void)
>> {
>> -#if !defined(CONFIG_DEBUG_PAGEALLOC) && !defined(CONFIG_KMEMCHECK)
>> +#if !defined(CONFIG_KMEMCHECK)
>> /*
>> - * For CONFIG_DEBUG_PAGEALLOC, identity mapping will use small pages.
>> + * For CONFIG_KMEMCHECK or pagealloc debugging, identity mapping will
>> + * use small pages.
>> * This will simplify cpa(), which otherwise needs to support splitting
>> * large pages into small in interrupt context, etc.
>> */
>> - if (cpu_has_pse)
>> + if (cpu_has_pse && !debug_pagealloc_enabled())
>> page_size_mask |= 1 << PG_LEVEL_2M;
>> #endif
>>
>
> 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.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 19+ messages in thread* Re: [PATCH v3 2/3] x86: query dynamic DEBUG_PAGEALLOC setting
2016-01-28 9:48 ` Christian Borntraeger
@ 2016-01-28 23:03 ` David Rientjes
2016-02-02 21:51 ` David Rientjes
2016-02-02 21:52 ` (unknown) David Rientjes via Linuxppc-dev
2016-01-28 23:04 ` (unknown) David Rientjes via Linuxppc-dev
1 sibling, 2 replies; 19+ messages in thread
From: David Rientjes @ 2016-01-28 23:03 UTC (permalink / raw)
To: Christian Borntraeger
Cc: akpm, linux-kernel, linux-mm, linux-arch, linux-s390, x86,
linuxppc-dev, davem, Joonsoo Kim, davej
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.
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH v3 2/3] x86: query dynamic DEBUG_PAGEALLOC setting
2016-01-28 23:03 ` David Rientjes
@ 2016-02-02 21:51 ` David Rientjes
2016-02-02 21:53 ` Christian Borntraeger
2016-02-02 21:52 ` (unknown) David Rientjes via Linuxppc-dev
1 sibling, 1 reply; 19+ messages in thread
From: David Rientjes @ 2016-02-02 21:51 UTC (permalink / raw)
To: Christian Borntraeger
Cc: akpm, linux-kernel, linux-mm, linux-arch, linux-s390, x86,
linuxppc-dev, davem, Joonsoo Kim, davej
On Thu, 28 Jan 2016, David Rientjes wrote:
> 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.
>
Ping?
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH v3 2/3] x86: query dynamic DEBUG_PAGEALLOC setting
2016-02-02 21:51 ` David Rientjes
@ 2016-02-02 21:53 ` Christian Borntraeger
2016-02-02 22:21 ` Andrew Morton
0 siblings, 1 reply; 19+ messages in thread
From: Christian Borntraeger @ 2016-02-02 21:53 UTC (permalink / raw)
To: David Rientjes
Cc: akpm, linux-kernel, linux-mm, linux-arch, linux-s390, x86,
linuxppc-dev, davem, Joonsoo Kim, davej
On 02/02/2016 10:51 PM, David Rientjes wrote:
> On Thu, 28 Jan 2016, David Rientjes wrote:
>
>> 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.
>>
>
> Ping?
>
https://lkml.org/lkml/2016/1/29/266
?
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH v3 2/3] x86: query dynamic DEBUG_PAGEALLOC setting
2016-02-02 21:53 ` Christian Borntraeger
@ 2016-02-02 22:21 ` Andrew Morton
2016-02-02 22:37 ` Christian Borntraeger
0 siblings, 1 reply; 19+ messages in thread
From: Andrew Morton @ 2016-02-02 22:21 UTC (permalink / raw)
To: Christian Borntraeger
Cc: David Rientjes, linux-kernel, linux-mm, linux-arch, linux-s390,
x86, linuxppc-dev, davem, Joonsoo Kim, davej
On Tue, 2 Feb 2016 22:53:36 +0100 Christian Borntraeger <borntraeger@de.ibm.com> wrote:
> >> 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.
> >>
> >
> > Ping?
> >
> https://lkml.org/lkml/2016/1/29/266
That's already in linux-next so I can't apply it.
Well, I can, but it's a hassle. What's happening here?
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH v3 2/3] x86: query dynamic DEBUG_PAGEALLOC setting
2016-02-02 22:21 ` Andrew Morton
@ 2016-02-02 22:37 ` Christian Borntraeger
2016-02-02 23:04 ` Andrew Morton
0 siblings, 1 reply; 19+ messages in thread
From: Christian Borntraeger @ 2016-02-02 22:37 UTC (permalink / raw)
To: Andrew Morton
Cc: David Rientjes, linux-kernel, linux-mm, linux-arch, linux-s390,
x86, linuxppc-dev, davem, Joonsoo Kim, davej
On 02/02/2016 11:21 PM, Andrew Morton wrote:
> On Tue, 2 Feb 2016 22:53:36 +0100 Christian Borntraeger <borntraeger@de.ibm.com> wrote:
>
>>>> 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.
>>>>
>>>
>>> Ping?
>>>
>> https://lkml.org/lkml/2016/1/29/266
>
> 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.
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH v3 2/3] x86: query dynamic DEBUG_PAGEALLOC setting
2016-02-02 22:37 ` Christian Borntraeger
@ 2016-02-02 23:04 ` Andrew Morton
2016-02-03 0:13 ` Stephen Rothwell
0 siblings, 1 reply; 19+ messages in thread
From: Andrew Morton @ 2016-02-02 23:04 UTC (permalink / raw)
To: Christian Borntraeger
Cc: David Rientjes, linux-kernel, linux-mm, linux-arch, linux-s390,
x86, linuxppc-dev, davem, Joonsoo Kim, davej
On Tue, 2 Feb 2016 23:37:50 +0100 Christian Borntraeger <borntraeger@de.ibm.com> wrote:
> On 02/02/2016 11:21 PM, Andrew Morton wrote:
> > On Tue, 2 Feb 2016 22:53:36 +0100 Christian Borntraeger <borntraeger@de.ibm.com> wrote:
> >
> >>>> 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.
> >>>>
> >>>
> >>> Ping?
> >>>
> >> https://lkml.org/lkml/2016/1/29/266
> >
> > 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.
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH v3 2/3] x86: query dynamic DEBUG_PAGEALLOC setting
2016-02-02 23:04 ` Andrew Morton
@ 2016-02-03 0:13 ` Stephen Rothwell
0 siblings, 0 replies; 19+ messages in thread
From: Stephen Rothwell @ 2016-02-03 0:13 UTC (permalink / raw)
To: Andrew Morton
Cc: Christian Borntraeger, David Rientjes, linux-kernel, linux-mm,
linux-arch, linux-s390, x86, linuxppc-dev, davem, Joonsoo Kim,
davej
Hi Andrew,
On Tue, 2 Feb 2016 15:04:35 -0800 Andrew Morton <akpm@linux-foundation.org> wrote:
>
> On Tue, 2 Feb 2016 23:37:50 +0100 Christian Borntraeger <borntraeger@de.ibm.com> wrote:
>
> >
> > 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
^ permalink raw reply [flat|nested] 19+ messages in thread
* (unknown)
2016-01-28 23:03 ` David Rientjes
2016-02-02 21:51 ` David Rientjes
@ 2016-02-02 21:52 ` David Rientjes via Linuxppc-dev
1 sibling, 0 replies; 19+ messages in thread
From: David Rientjes via Linuxppc-dev @ 2016-02-02 21:52 UTC (permalink / raw)
To: Christian Borntraeger
Cc: linux-arch, linux-s390, davej, x86, linux-kernel, linux-mm,
Joonsoo Kim, akpm, linuxppc-dev, davem
[-- Attachment #1: Type: message/rfc822, Size: 5486 bytes --]
From: David Rientjes <rientjes@google.com>
To: Christian Borntraeger <borntraeger@de.ibm.com>
Cc: akpm@linux-foundation.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-arch@vger.kernel.org, linux-s390@vger.kernel.org, x86@kernel.org, linuxppc-dev@lists.ozlabs.org, davem@davemloft.net, Joonsoo Kim <iamjoonsoo.kim@lge.com>, davej@codemonkey.org.uk
Subject: Re: [PATCH v3 2/3] x86: query dynamic DEBUG_PAGEALLOC setting
Date: Tue, 2 Feb 2016 13:51:34 -0800 (PST)
Message-ID: <alpine.DEB.2.10.1602021351290.4977@chino.kir.corp.google.com>
On Thu, 28 Jan 2016, David Rientjes wrote:
> 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.
>
Ping?
[-- Attachment #2: Type: text/plain, Size: 150 bytes --]
_______________________________________________
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev
^ permalink raw reply [flat|nested] 19+ messages in thread
* (unknown)
2016-01-28 9:48 ` Christian Borntraeger
2016-01-28 23:03 ` David Rientjes
@ 2016-01-28 23:04 ` David Rientjes via Linuxppc-dev
1 sibling, 0 replies; 19+ messages in thread
From: David Rientjes via Linuxppc-dev @ 2016-01-28 23:04 UTC (permalink / raw)
To: Christian Borntraeger
Cc: linux-arch, linux-s390, davej, x86, linux-kernel, linux-mm,
Joonsoo Kim, akpm, linuxppc-dev, davem
[-- Attachment #1: Type: message/rfc822, Size: 5371 bytes --]
From: David Rientjes <rientjes@google.com>
To: Christian Borntraeger <borntraeger@de.ibm.com>
Cc: akpm@linux-foundation.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-arch@vger.kernel.org, linux-s390@vger.kernel.org, x86@kernel.org, linuxppc-dev@lists.ozlabs.org, davem@davemloft.net, Joonsoo Kim <iamjoonsoo.kim@lge.com>, davej@codemonkey.org.uk
Subject: Re: [PATCH v3 2/3] x86: query dynamic DEBUG_PAGEALLOC setting
Date: Thu, 28 Jan 2016 15:03:39 -0800 (PST)
Message-ID: <alpine.DEB.2.10.1601281500160.31035@chino.kir.corp.google.com>
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.
[-- Attachment #2: Type: text/plain, Size: 150 bytes --]
_______________________________________________
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev
^ permalink raw reply [flat|nested] 19+ messages in thread
* (unknown)
2016-01-27 10:10 ` [PATCH v3 2/3] x86: query dynamic DEBUG_PAGEALLOC setting Christian Borntraeger
2016-01-27 22:17 ` David Rientjes
@ 2016-01-27 22:18 ` David Rientjes via Linuxppc-dev
1 sibling, 0 replies; 19+ messages in thread
From: David Rientjes via Linuxppc-dev @ 2016-01-27 22:18 UTC (permalink / raw)
To: Christian Borntraeger
Cc: linux-arch, linux-s390, davej, x86, linux-kernel, linux-mm,
Joonsoo Kim, akpm, linuxppc-dev, davem
[-- Attachment #1: Type: message/rfc822, Size: 5626 bytes --]
From: David Rientjes <rientjes@google.com>
To: Christian Borntraeger <borntraeger@de.ibm.com>
Cc: akpm@linux-foundation.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-arch@vger.kernel.org, linux-s390@vger.kernel.org, x86@kernel.org, linuxppc-dev@lists.ozlabs.org, davem@davemloft.net, Joonsoo Kim <iamjoonsoo.kim@lge.com>, davej@codemonkey.org.uk
Subject: Re: [PATCH v3 2/3] x86: query dynamic DEBUG_PAGEALLOC setting
Date: Wed, 27 Jan 2016 14:17:05 -0800 (PST)
Message-ID: <alpine.DEB.2.10.1601271414180.23510@chino.kir.corp.google.com>
On Wed, 27 Jan 2016, Christian Borntraeger wrote:
> 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 <borntraeger@de.ibm.com>
> Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
> ---
> 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(-)
>
> diff --git a/arch/x86/kernel/dumpstack.c b/arch/x86/kernel/dumpstack.c
> index 9c30acf..32e5699 100644
> --- a/arch/x86/kernel/dumpstack.c
> +++ b/arch/x86/kernel/dumpstack.c
> @@ -265,9 +265,8 @@ int __die(const char *str, struct pt_regs *regs, long err)
> #ifdef CONFIG_SMP
> printk("SMP ");
> #endif
> -#ifdef CONFIG_DEBUG_PAGEALLOC
> - printk("DEBUG_PAGEALLOC ");
> -#endif
> + if (debug_pagealloc_enabled())
> + printk("DEBUG_PAGEALLOC ");
> #ifdef CONFIG_KASAN
> printk("KASAN");
> #endif
> diff --git a/arch/x86/mm/init.c b/arch/x86/mm/init.c
> index 493f541..39823fd 100644
> --- a/arch/x86/mm/init.c
> +++ b/arch/x86/mm/init.c
> @@ -150,13 +150,14 @@ static int page_size_mask;
>
> static void __init probe_page_size_mask(void)
> {
> -#if !defined(CONFIG_DEBUG_PAGEALLOC) && !defined(CONFIG_KMEMCHECK)
> +#if !defined(CONFIG_KMEMCHECK)
> /*
> - * For CONFIG_DEBUG_PAGEALLOC, identity mapping will use small pages.
> + * For CONFIG_KMEMCHECK or pagealloc debugging, identity mapping will
> + * use small pages.
> * This will simplify cpa(), which otherwise needs to support splitting
> * large pages into small in interrupt context, etc.
> */
> - if (cpu_has_pse)
> + if (cpu_has_pse && !debug_pagealloc_enabled())
> page_size_mask |= 1 << PG_LEVEL_2M;
> #endif
>
I would have thought free_init_pages() would be modified to use
debug_pagealloc_enabled() as well?
[-- Attachment #2: Type: text/plain, Size: 150 bytes --]
_______________________________________________
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev
^ permalink raw reply [flat|nested] 19+ messages in thread
* [PATCH v3 3/3] s390: query dynamic DEBUG_PAGEALLOC setting
2016-01-27 10:09 [PATCH v3 0/3] Optimize CONFIG_DEBUG_PAGEALLOC Christian Borntraeger
2016-01-27 10:09 ` [PATCH v3 1/3] mm: provide debug_pagealloc_enabled() without CONFIG_DEBUG_PAGEALLOC Christian Borntraeger
2016-01-27 10:10 ` [PATCH v3 2/3] x86: query dynamic DEBUG_PAGEALLOC setting Christian Borntraeger
@ 2016-01-27 10:10 ` Christian Borntraeger
2016-01-27 22:18 ` David Rientjes
2016-01-27 22:22 ` (unknown) David Rientjes via Linuxppc-dev
2 siblings, 2 replies; 19+ messages in thread
From: Christian Borntraeger @ 2016-01-27 10:10 UTC (permalink / raw)
To: akpm
Cc: linux-kernel, linux-mm, linux-arch, linux-s390, x86, linuxppc-dev,
davem, Joonsoo Kim, davej, Christian Borntraeger
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 <borntraeger@de.ibm.com>
Reviewed-by: Heiko Carstens <heiko.carstens@de.ibm.com>
---
arch/s390/kernel/dumpstack.c | 6 +++---
arch/s390/mm/vmem.c | 10 ++++------
2 files changed, 7 insertions(+), 9 deletions(-)
diff --git a/arch/s390/kernel/dumpstack.c b/arch/s390/kernel/dumpstack.c
index dc8e204..e57eb22 100644
--- a/arch/s390/kernel/dumpstack.c
+++ b/arch/s390/kernel/dumpstack.c
@@ -11,6 +11,7 @@
#include <linux/export.h>
#include <linux/kdebug.h>
#include <linux/ptrace.h>
+#include <linux/mm.h>
#include <linux/module.h>
#include <linux/sched.h>
#include <asm/processor.h>
@@ -185,9 +186,8 @@ void die(struct pt_regs *regs, const char *str)
#ifdef CONFIG_SMP
printk("SMP ");
#endif
-#ifdef CONFIG_DEBUG_PAGEALLOC
- printk("DEBUG_PAGEALLOC");
-#endif
+ if (debug_pagealloc_enabled())
+ printk("DEBUG_PAGEALLOC");
printk("\n");
notify_die(DIE_OOPS, str, regs, 0, regs->int_code & 0xffff, SIGSEGV);
print_modules();
diff --git a/arch/s390/mm/vmem.c b/arch/s390/mm/vmem.c
index ef7d6c8..d27fccba 100644
--- a/arch/s390/mm/vmem.c
+++ b/arch/s390/mm/vmem.c
@@ -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_PAGEALLOC
if (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;
}
-#endif
if (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_PAGEALLOC
if (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;
}
-#endif
if (pmd_none(*pm_dir)) {
pt_dir = vmem_pte_alloc(address);
if (!pt_dir)
--
2.3.0
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply related [flat|nested] 19+ messages in thread* Re: [PATCH v3 3/3] s390: query dynamic DEBUG_PAGEALLOC setting
2016-01-27 10:10 ` [PATCH v3 3/3] s390: query dynamic DEBUG_PAGEALLOC setting Christian Borntraeger
@ 2016-01-27 22:18 ` David Rientjes
2016-01-27 22:22 ` (unknown) David Rientjes via Linuxppc-dev
1 sibling, 0 replies; 19+ messages in thread
From: David Rientjes @ 2016-01-27 22:18 UTC (permalink / raw)
To: Christian Borntraeger
Cc: akpm, linux-kernel, linux-mm, linux-arch, linux-s390, x86,
linuxppc-dev, davem, Joonsoo Kim, davej
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 <borntraeger@de.ibm.com>
> Reviewed-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Acked-by: David Rientjes <rientjes@google.com>
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 19+ messages in thread
* (unknown)
2016-01-27 10:10 ` [PATCH v3 3/3] s390: query dynamic DEBUG_PAGEALLOC setting Christian Borntraeger
2016-01-27 22:18 ` David Rientjes
@ 2016-01-27 22:22 ` David Rientjes via Linuxppc-dev
1 sibling, 0 replies; 19+ messages in thread
From: David Rientjes via Linuxppc-dev @ 2016-01-27 22:22 UTC (permalink / raw)
To: Christian Borntraeger
Cc: linux-arch, linux-s390, davej, x86, linux-kernel, linux-mm,
Joonsoo Kim, akpm, linuxppc-dev, davem
[-- Attachment #1: Type: message/rfc822, Size: 3939 bytes --]
From: David Rientjes <rientjes@google.com>
To: Christian Borntraeger <borntraeger@de.ibm.com>
Cc: akpm@linux-foundation.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-arch@vger.kernel.org, linux-s390@vger.kernel.org, x86@kernel.org, linuxppc-dev@lists.ozlabs.org, davem@davemloft.net, Joonsoo Kim <iamjoonsoo.kim@lge.com>, davej@codemonkey.org.uk
Subject: Re: [PATCH v3 3/3] s390: query dynamic DEBUG_PAGEALLOC setting
Date: Wed, 27 Jan 2016 14:18:29 -0800 (PST)
Message-ID: <alpine.DEB.2.10.1601271418190.23510@chino.kir.corp.google.com>
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 <borntraeger@de.ibm.com>
> Reviewed-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Acked-by: David Rientjes <rientjes@google.com>
[-- Attachment #2: Type: text/plain, Size: 150 bytes --]
_______________________________________________
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev
^ permalink raw reply [flat|nested] 19+ messages in thread
* [PATCH v3 1/8] arm: put types.h in uapi
2017-01-13 10:46 ` [PATCH v3 0/8] " Nicolas Dichtel
@ 2017-01-13 10:46 Nicolas Dichtel
2017-01-09 11:33 ` [PATCH v2 0/7] uapi: export all headers under uapi directories Arnd Bergmann
0 siblings, 1 reply; 19+ messages in thread
From: Nicolas Dichtel @ 2017-01-13 10:46 UTC (permalink / raw)
To: arnd
Cc: mmarek, linux-kbuild, linux-doc, linux-kernel, linux-alpha,
linux-snps-arc, linux-arm-kernel, adi-buildroot-devel,
linux-c6x-dev, linux-cris-kernel, uclinux-h8-devel, linux-hexagon,
linux-ia64, linux-m68k, linux-metag, linux-mips, linux-am33-list,
nios2-dev, openrisc, linux-parisc, linuxppc-dev, linux-s390,
linux-sh, sparclinux, linux-xtensa, linux-arch
This header file is exported, thus move it to uapi.
Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
---
arch/arm/include/asm/types.h | 40 ---------------------------------------
arch/arm/include/uapi/asm/types.h | 40 +++++++++++++++++++++++++++++++++++++++
2 files changed, 40 insertions(+), 40 deletions(-)
delete mode 100644 arch/arm/include/asm/types.h
create mode 100644 arch/arm/include/uapi/asm/types.h
diff --git a/arch/arm/include/asm/types.h b/arch/arm/include/asm/types.h
deleted file mode 100644
index a53cdb8f068c..000000000000
--- a/arch/arm/include/asm/types.h
+++ /dev/null
@@ -1,40 +0,0 @@
-#ifndef _ASM_TYPES_H
-#define _ASM_TYPES_H
-
-#include <asm-generic/int-ll64.h>
-
-/*
- * The C99 types uintXX_t that are usually defined in 'stdint.h' are not as
- * unambiguous on ARM as you would expect. For the types below, there is a
- * difference on ARM between GCC built for bare metal ARM, GCC built for glibc
- * and the kernel itself, which results in build errors if you try to build with
- * -ffreestanding and include 'stdint.h' (such as when you include 'arm_neon.h'
- * in order to use NEON intrinsics)
- *
- * As the typedefs for these types in 'stdint.h' are based on builtin defines
- * supplied by GCC, we can tweak these to align with the kernel's idea of those
- * types, so 'linux/types.h' and 'stdint.h' can be safely included from the same
- * source file (provided that -ffreestanding is used).
- *
- * int32_t uint32_t uintptr_t
- * bare metal GCC long unsigned long unsigned int
- * glibc GCC int unsigned int unsigned int
- * kernel int unsigned int unsigned long
- */
-
-#ifdef __INT32_TYPE__
-#undef __INT32_TYPE__
-#define __INT32_TYPE__ int
-#endif
-
-#ifdef __UINT32_TYPE__
-#undef __UINT32_TYPE__
-#define __UINT32_TYPE__ unsigned int
-#endif
-
-#ifdef __UINTPTR_TYPE__
-#undef __UINTPTR_TYPE__
-#define __UINTPTR_TYPE__ unsigned long
-#endif
-
-#endif /* _ASM_TYPES_H */
diff --git a/arch/arm/include/uapi/asm/types.h b/arch/arm/include/uapi/asm/types.h
new file mode 100644
index 000000000000..9435a42f575e
--- /dev/null
+++ b/arch/arm/include/uapi/asm/types.h
@@ -0,0 +1,40 @@
+#ifndef _UAPI_ASM_TYPES_H
+#define _UAPI_ASM_TYPES_H
+
+#include <asm-generic/int-ll64.h>
+
+/*
+ * The C99 types uintXX_t that are usually defined in 'stdint.h' are not as
+ * unambiguous on ARM as you would expect. For the types below, there is a
+ * difference on ARM between GCC built for bare metal ARM, GCC built for glibc
+ * and the kernel itself, which results in build errors if you try to build with
+ * -ffreestanding and include 'stdint.h' (such as when you include 'arm_neon.h'
+ * in order to use NEON intrinsics)
+ *
+ * As the typedefs for these types in 'stdint.h' are based on builtin defines
+ * supplied by GCC, we can tweak these to align with the kernel's idea of those
+ * types, so 'linux/types.h' and 'stdint.h' can be safely included from the same
+ * source file (provided that -ffreestanding is used).
+ *
+ * int32_t uint32_t uintptr_t
+ * bare metal GCC long unsigned long unsigned int
+ * glibc GCC int unsigned int unsigned int
+ * kernel int unsigned int unsigned long
+ */
+
+#ifdef __INT32_TYPE__
+#undef __INT32_TYPE__
+#define __INT32_TYPE__ int
+#endif
+
+#ifdef __UINT32_TYPE__
+#undef __UINT32_TYPE__
+#define __UINT32_TYPE__ unsigned int
+#endif
+
+#ifdef __UINTPTR_TYPE__
+#undef __UINTPTR_TYPE__
+#define __UINTPTR_TYPE__ unsigned long
+#endif
+
+#endif /* _UAPI_ASM_TYPES_H */
--
2.8.1
^ permalink raw reply related [flat|nested] 19+ messages in thread
* Re: [PATCH v2 0/7] uapi: export all headers under uapi directories
@ 2017-01-09 11:33 ` Arnd Bergmann
2017-01-13 10:46 ` [PATCH v3 0/8] " Nicolas Dichtel
0 siblings, 1 reply; 19+ messages in thread
From: Arnd Bergmann @ 2017-01-09 11:33 UTC (permalink / raw)
To: linuxppc-dev, linux-kbuild
Cc: linux-mips, alsa-devel, linux-ia64, linux-doc, airlied,
linux-fbdev, dri-devel, linux-mtd, sparclinux, linux-arch,
linux-s390, linux-am33-list, linux-c6x-dev, linux-rdma,
linux-hexagon, linux-sh, coreteam, fcoe-devel, xen-devel,
linux-snps-arc, linux-media, uclinux-h8-devel,
adi-buildroot-devel, linux-raid, linux-m68k, openrisc,
Nicolas Dichtel, linux-metag, linux-arm-kernel
On Friday, January 6, 2017 10:43:52 AM CET Nicolas Dichtel wrote:
> Here is the v2 of this series. The first 5 patches are just cleanup: some
> exported headers were still under a non-uapi directory.
Since this is meant as a cleanup, I commented on this to point out a cleaner
way to do the same.
> The patch 6 was spotted by code review: there is no in-tree user of this
> functionality.
> The last patch remove the use of header-y. Now all files under an uapi
> directory are exported.
Very nice!
> asm is a bit special, most of architectures export asm/<arch>/include/uapi/asm
> only, but there is two exceptions:
> - cris which exports arch/cris/include/uapi/arch-v[10|32];
This is interesting, though not your problem. Maybe someone who understands
cris better can comment on this: How is the decision made about which of
the arch/user.h headers gets used? I couldn't find that in the sources,
but it appears to be based on kernel compile-time settings, which is
wrong for user space header files that should be independent of the kernel
config.
> - tile which exports arch/tile/include/uapi/arch.
> Because I don't know if the output of 'make headers_install_all' can be changed,
> I introduce subdir-y in Kbuild file. The headers_install_all target copies all
> asm/<arch>/include/uapi/asm to usr/include/asm-<arch> but
> arch/cris/include/uapi/arch-v[10|32] and arch/tile/include/uapi/arch are not
> prefixed (they are put asis in usr/include/). If it's acceptable to modify the
> output of 'make headers_install_all' to export asm headers in
> usr/include/asm-<arch>/asm, then I could remove this new subdir-y and exports
> everything under arch/<arch>/include/uapi/.
I don't know if anyone still uses "make headers_install_all", I suspect
distros these days all use "make headers_install", so it probably
doesn't matter much.
In case of cris, it should be easy enough to move all the contents of the
uapi/arch-*/*.h headers into the respective uapi/asm/*.h headers, they
only seem to be referenced from there.
For tile, I suspect that would not work as the arch/*.h headers are
apparently defined as interfaces for both user space and kernel.
> Note also that exported files for asm are a mix of files listed by:
> - include/uapi/asm-generic/Kbuild.asm;
> - arch/x86/include/uapi/asm/Kbuild;
> - arch/x86/include/asm/Kbuild.
> This complicates a lot the processing (arch/x86/include/asm/Kbuild is also
> used by scripts/Makefile.asm-generic).
>
> This series has been tested with a 'make headers_install' on x86 and a
> 'make headers_install_all'. I've checked the result of both commands.
>
> This patch is built against linus tree. I don't know if it should be
> made against antoher tree.
The series should probably get merged through the kbuild tree, but testing
it on mainline is fine here.
Arnd
^ permalink raw reply [flat|nested] 19+ messages in thread
* [PATCH v3 0/8] uapi: export all headers under uapi directories
2017-01-09 11:33 ` [PATCH v2 0/7] uapi: export all headers under uapi directories Arnd Bergmann
@ 2017-01-13 10:46 ` Nicolas Dichtel
2017-01-13 15:36 ` (unknown) David Howells
0 siblings, 1 reply; 19+ messages in thread
From: Nicolas Dichtel @ 2017-01-13 10:46 UTC (permalink / raw)
To: arnd
Cc: linux-mips, alsa-devel, linux-ia64, linux-doc, airlied,
daniel.vetter, linux-fbdev, dri-devel, linux-mtd, sparclinux,
linux-arch, linux-s390, linux-am33-list, linux-c6x-dev,
linux-rdma, linux-hexagon, linux-sh, linux, hch, coreteam,
msalter, fcoe-devel, xen-devel, linux-snps-arc, linux-media,
uclinux-h8-devel, linux-xtensa, linux-kbuild, adi-buildroot-devel,
linux-raid, linux-m68k
Here is the v3 of this series. The first 5 patches are just cleanup: some
exported headers were still under a non-uapi directory or (x86 case) were
wrongly exported.
The patch 6 was spotted by code review: there is no in-tree user of this
functionality.
Patches 7 and 8 remove the need to list explicitly headers. Now all files
under an uapi directory are exported.
This series has been tested with a 'make headers_install' on x86 and a
'make headers_install_all'. I've checked the result of both commands.
This patch is built against linus tree. If I must rebase it against the kbuild
tree, just tell me ;-)
v2 -> v3:
- patch #1: remove arch/arm/include/asm/types.h
- patch #2: remove arch/h8300/include/asm/bitsperlong.h
- patch #3: remove arch/nios2/include/uapi/asm/setup.h
- patch #4: don't export msr-index.h
- patch #5: fix a typo: s/unput-files3-name/input-files3-name
- patch #6: no change
- patch #7: fix include/uapi/asm-generic/Kbuild.asm by introducing mandatory-y
- add patch #8
v1 -> v2:
- add patch #1 to #6
- patch #7: remove use of header-y
Comments are welcomed,
Nicolas
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 19+ messages in thread
* (unknown)
2017-01-13 10:46 ` [PATCH v3 0/8] " Nicolas Dichtel
@ 2017-01-13 15:36 ` David Howells
0 siblings, 0 replies; 19+ messages in thread
From: David Howells @ 2017-01-13 15:36 UTC (permalink / raw)
To: Nicolas Dichtel
Cc: dhowells, arnd, linux-mips, linux-m68k, linux-ia64, linux-doc,
alsa-devel, dri-devel, linux-mtd, sparclinux, linux-arch,
linux-s390, linux-am33-list, linux-c6x-dev, linux-rdma,
linux-hexagon, linux-sh, linux, coreteam, fcoe-devel, xen-devel,
linux-snps-arc, linux-media, uclinux-h8-devel, linux-xtensa,
linux-kbuild, adi-buildroot-devel
Nicolas Dichtel <nicolas.dichtel@6wind.com> wrote:
> This header file is exported, thus move it to uapi.
Exported how?
> +#ifdef __INT32_TYPE__
> +#undef __INT32_TYPE__
> +#define __INT32_TYPE__ int
> +#endif
> +
> +#ifdef __UINT32_TYPE__
> +#undef __UINT32_TYPE__
> +#define __UINT32_TYPE__ unsigned int
> +#endif
> +
> +#ifdef __UINTPTR_TYPE__
> +#undef __UINTPTR_TYPE__
> +#define __UINTPTR_TYPE__ unsigned long
> +#endif
These weren't defined by the kernel before, so why do we need to define them
now?
Will defining __UINTPTR_TYPE__ cause problems in compiling libboost by
changing the signature on C++ functions that use uintptr_t?
David
^ permalink raw reply [flat|nested] 19+ messages in thread
end of thread, other threads:[~2017-01-13 15:36 UTC | newest]
Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-27 10:09 [PATCH v3 0/3] Optimize CONFIG_DEBUG_PAGEALLOC Christian Borntraeger
2016-01-27 10:09 ` [PATCH v3 1/3] mm: provide debug_pagealloc_enabled() without CONFIG_DEBUG_PAGEALLOC Christian Borntraeger
2016-01-27 10:10 ` [PATCH v3 2/3] x86: query dynamic DEBUG_PAGEALLOC setting Christian Borntraeger
2016-01-27 22:17 ` David Rientjes
2016-01-28 9:48 ` Christian Borntraeger
2016-01-28 23:03 ` David Rientjes
2016-02-02 21:51 ` David Rientjes
2016-02-02 21:53 ` Christian Borntraeger
2016-02-02 22:21 ` Andrew Morton
2016-02-02 22:37 ` Christian Borntraeger
2016-02-02 23:04 ` Andrew Morton
2016-02-03 0:13 ` Stephen Rothwell
2016-02-02 21:52 ` (unknown) David Rientjes via Linuxppc-dev
2016-01-28 23:04 ` (unknown) David Rientjes via Linuxppc-dev
2016-01-27 22:18 ` (unknown) David Rientjes via Linuxppc-dev
2016-01-27 10:10 ` [PATCH v3 3/3] s390: query dynamic DEBUG_PAGEALLOC setting Christian Borntraeger
2016-01-27 22:18 ` David Rientjes
2016-01-27 22:22 ` (unknown) David Rientjes via Linuxppc-dev
-- strict thread matches above, loose matches on Subject: below --
2017-01-13 10:46 [PATCH v3 1/8] arm: put types.h in uapi Nicolas Dichtel
2017-01-09 11:33 ` [PATCH v2 0/7] uapi: export all headers under uapi directories Arnd Bergmann
2017-01-13 10:46 ` [PATCH v3 0/8] " Nicolas Dichtel
2017-01-13 15:36 ` (unknown) David Howells
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).