From: Joonsoo Kim <hidden> Date: 2016-02-04 05:57:30
As CONFIG_DEBUG_PAGEALLOC can be enabled/disabled via kernel
parameters we can optimize some cases by checking the enablement
state.
This is follow-up work for Christian's Optimize CONFIG_DEBUG_PAGEALLOC.
https://lkml.org/lkml/2016/1/27/194
I can't test patches for sound, power and tile,
so please review them, maintainers. :)
Remaining work is to make sparc to be aware of this but it looks
not easy for me so I skip that in this series.
It would be the best that these paches are routed through Andrew's tree,
because there is a dependency to MM.
Thanks.
Joonsoo Kim (5):
mm/vmalloc: query dynamic DEBUG_PAGEALLOC setting
mm/slub: query dynamic DEBUG_PAGEALLOC setting
sound: query dynamic DEBUG_PAGEALLOC setting
powerpc: query dynamic DEBUG_PAGEALLOC setting
tile: query dynamic DEBUG_PAGEALLOC setting
arch/powerpc/kernel/traps.c | 5 ++---
arch/powerpc/mm/hash_utils_64.c | 40 ++++++++++++++++++++--------------------
arch/powerpc/mm/init_32.c | 8 ++++----
arch/tile/mm/init.c | 11 +++++++----
mm/slub.c | 11 ++++++-----
mm/vmalloc.c | 8 ++++----
sound/drivers/pcsp/pcsp.c | 9 +++++----
7 files changed, 48 insertions(+), 44 deletions(-)
--
1.9.1
From: Joonsoo Kim <hidden> Date: 2016-02-04 05:58:14
We can disable debug_pagealloc processing even if the code is complied
with CONFIG_DEBUG_PAGEALLOC. This patch changes the code to query
whether it is enabled or not in runtime.
Signed-off-by: Joonsoo Kim <redacted>
---
mm/vmalloc.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
@@ -543,10 +543,10 @@ static void vmap_debug_free_range(unsigned long start, unsigned long end)*debuggingdoesn'tdoabroadcastTLBflushsoitisalot*faster).*/-#ifdef CONFIG_DEBUG_PAGEALLOC-vunmap_page_range(start,end);-flush_tlb_kernel_range(start,end);-#endif+if(debug_pagealloc_enabled()){+vunmap_page_range(start,end);+flush_tlb_kernel_range(start,end);+}}/*
--
1.9.1
--
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>
From: Joonsoo Kim <hidden> Date: 2016-02-04 05:58:16
We can disable debug_pagealloc processing even if the code is complied
with CONFIG_DEBUG_PAGEALLOC. This patch changes the code to query
whether it is enabled or not in runtime.
Signed-off-by: Joonsoo Kim <redacted>
---
mm/slub.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
--
1.9.1
--
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>
From: Joonsoo Kim <hidden> Date: 2016-02-04 05:58:19
We can disable debug_pagealloc processing even if the code is complied
with CONFIG_DEBUG_PAGEALLOC. This patch changes the code to query
whether it is enabled or not in runtime.
Signed-off-by: Joonsoo Kim <redacted>
---
sound/drivers/pcsp/pcsp.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
@@ -148,11 +149,11 @@ static int alsa_card_pcsp_init(struct device *dev)returnerr;}-#ifdef CONFIG_DEBUG_PAGEALLOC/* Well, CONFIG_DEBUG_PAGEALLOC makes the sound horrible. Lets alert */-printk(KERN_WARNING"PCSP: CONFIG_DEBUG_PAGEALLOC is enabled, "-"which may make the sound noisy.\n");-#endif+if(debug_pagealloc_enabled()){+printk(KERN_WARNING"PCSP: CONFIG_DEBUG_PAGEALLOC is enabled, "+"which may make the sound noisy.\n");+}return0;}
--
1.9.1
--
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>
From: Joonsoo Kim <hidden> Date: 2016-02-04 05:58:21
We can disable debug_pagealloc processing even if the code is complied
with CONFIG_DEBUG_PAGEALLOC. This patch changes the code to query
whether it is enabled or not in runtime.
Signed-off-by: Joonsoo Kim <redacted>
---
arch/powerpc/kernel/traps.c | 5 ++---
arch/powerpc/mm/hash_utils_64.c | 40 ++++++++++++++++++++--------------------
arch/powerpc/mm/init_32.c | 8 ++++----
3 files changed, 26 insertions(+), 27 deletions(-)
@@ -255,10 +255,10 @@ int htab_bolt_mapping(unsigned long vstart, unsigned long vend,if(ret<0)break;-#ifdef CONFIG_DEBUG_PAGEALLOC-if((paddr>>PAGE_SHIFT)<linear_map_hash_count)++if(debug_pagealloc_enabled()&&+(paddr>>PAGE_SHIFT)<linear_map_hash_count)linear_map_hash_slots[paddr>>PAGE_SHIFT]=ret|0x80;-#endif /* CONFIG_DEBUG_PAGEALLOC */}returnret<0?ret:0;}
@@ -720,12 +720,12 @@ static void __init htab_initialize(void)prot=pgprot_val(PAGE_KERNEL);-#ifdef CONFIG_DEBUG_PAGEALLOC-linear_map_hash_count=memblock_end_of_DRAM()>>PAGE_SHIFT;-linear_map_hash_slots=__va(memblock_alloc_base(linear_map_hash_count,-1,ppc64_rma_size));-memset(linear_map_hash_slots,0,linear_map_hash_count);-#endif /* CONFIG_DEBUG_PAGEALLOC */+if(debug_pagealloc_enabled()){+linear_map_hash_count=memblock_end_of_DRAM()>>PAGE_SHIFT;+linear_map_hash_slots=__va(memblock_alloc_base(+linear_map_hash_count,1,ppc64_rma_size));+memset(linear_map_hash_slots,0,linear_map_hash_count);+}/* On U3 based machines, we need to reserve the DART area and*_NOT_mapittoavoidcacheparadoxesasit'sremappednon
--
1.9.1
--
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>
From: Joonsoo Kim <hidden> Date: 2016-02-04 05:58:24
We can disable debug_pagealloc processing even if the code is complied
with CONFIG_DEBUG_PAGEALLOC. This patch changes the code to query
whether it is enabled or not in runtime.
Signed-off-by: Joonsoo Kim <redacted>
---
arch/tile/mm/init.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
@@ -896,17 +896,15 @@ void __init pgtable_cache_init(void)panic("pgtable_cache_init(): Cannot create pgd cache");}-#ifdef CONFIG_DEBUG_PAGEALLOC-staticlong__write_onceinitfree;-#elsestaticlong__write_onceinitfree=1;-#endif+staticbool__write_onceset_initfree_done;/* Select whether to free (1) or mark unusable (0) the __init pages. */staticint__initset_initfree(char*str){longval;if(kstrtol(str,0,&val)==0){+set_initfree_done=true;initfree=val;pr_info("initfree: %s free init pages\n",initfree?"will":"won't");
@@ -919,6 +917,11 @@ static void free_init_pages(char *what, unsigned long begin, unsigned long end){unsignedlongaddr=(unsignedlong)begin;+/* Prefer user request first */+if(!set_initfree_done){+if(debug_pagealloc_enabled())+initfree=0;+}if(kdata_huge&&!initfree){pr_warn("Warning: ignoring initfree=0: incompatible with kdata=huge\n");initfree=1;
--
1.9.1
--
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>
From: Christian Borntraeger <hidden> Date: 2016-02-04 08:31:23
On 02/04/2016 06:56 AM, Joonsoo Kim wrote:
quoted hunk
We can disable debug_pagealloc processing even if the code is complied
with CONFIG_DEBUG_PAGEALLOC. This patch changes the code to query
whether it is enabled or not in runtime.
Signed-off-by: Joonsoo Kim <redacted>
---
mm/slub.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
Hmm, this might be a good case for a line longer than 80 chars....
As an alternative revert the logic and return early:
if (!debug_pagealloc_enabled())
return get_freepointer(s, object);
probe_kernel_read(&p, (void **)(object + s->offset), sizeof(p));
return p;
?
From: Christian Borntraeger <hidden> Date: 2016-02-04 08:32:22
On 02/04/2016 06:56 AM, Joonsoo Kim wrote:
We can disable debug_pagealloc processing even if the code is complied
with CONFIG_DEBUG_PAGEALLOC. This patch changes the code to query
whether it is enabled or not in runtime.
Signed-off-by: Joonsoo Kim <redacted>
@@ -543,10 +543,10 @@ static void vmap_debug_free_range(unsigned long start, unsigned long end)*debuggingdoesn'tdoabroadcastTLBflushsoitisalot*faster).*/-#ifdef CONFIG_DEBUG_PAGEALLOC-vunmap_page_range(start,end);-flush_tlb_kernel_range(start,end);-#endif+if(debug_pagealloc_enabled()){+vunmap_page_range(start,end);+flush_tlb_kernel_range(start,end);+}}/*
--
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>
From: Joonsoo Kim <hidden> Date: 2016-02-04 16:21:21
2016-02-04 17:31 GMT+09:00 Christian Borntraeger [off-list ref]:
On 02/04/2016 06:56 AM, Joonsoo Kim wrote:
quoted
We can disable debug_pagealloc processing even if the code is complied
with CONFIG_DEBUG_PAGEALLOC. This patch changes the code to query
whether it is enabled or not in runtime.
Signed-off-by: Joonsoo Kim <redacted>
---
mm/slub.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
Hmm, this might be a good case for a line longer than 80 chars....
As an alternative revert the logic and return early:
if (!debug_pagealloc_enabled())
return get_freepointer(s, object);
probe_kernel_read(&p, (void **)(object + s->offset), sizeof(p));
return p;
Looks better!
I will fix it on next version.
Thanks.
--
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>
From: David Rientjes <rientjes@google.com> Date: 2016-02-04 22:18:32
On Thu, 4 Feb 2016, Joonsoo Kim wrote:
We can disable debug_pagealloc processing even if the code is complied
with CONFIG_DEBUG_PAGEALLOC. This patch changes the code to query
whether it is enabled or not in runtime.
Signed-off-by: Joonsoo Kim <redacted>
I think the comment immediately before this code referencing
CONFIG_DEBUG_PAGEALLOC should be changed to refer to pagealloc debugging
being enabled.
After that:
Acked-by: David Rientjes [off-list ref]
From: David Rientjes <rientjes@google.com> Date: 2016-02-04 22:19:33
On Thu, 4 Feb 2016, Joonsoo Kim wrote:
We can disable debug_pagealloc processing even if the code is complied
with CONFIG_DEBUG_PAGEALLOC. This patch changes the code to query
whether it is enabled or not in runtime.
Signed-off-by: Joonsoo Kim <redacted>
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>
From: David Rientjes <rientjes@google.com> Date: 2016-02-04 22:22:47
On Thu, 4 Feb 2016, Joonsoo Kim wrote:
We can disable debug_pagealloc processing even if the code is complied
with CONFIG_DEBUG_PAGEALLOC. This patch changes the code to query
whether it is enabled or not in runtime.
Signed-off-by: Joonsoo Kim <redacted>
On Thu, 04 Feb 2016 06:56:24 +0100,
Joonsoo Kim wrote:
We can disable debug_pagealloc processing even if the code is complied
with CONFIG_DEBUG_PAGEALLOC. This patch changes the code to query
whether it is enabled or not in runtime.
Signed-off-by: Joonsoo Kim <redacted>
@@ -148,11 +149,11 @@ static int alsa_card_pcsp_init(struct device *dev)returnerr;}-#ifdef CONFIG_DEBUG_PAGEALLOC/* Well, CONFIG_DEBUG_PAGEALLOC makes the sound horrible. Lets alert */-printk(KERN_WARNING"PCSP: CONFIG_DEBUG_PAGEALLOC is enabled, "-"which may make the sound noisy.\n");-#endif+if(debug_pagealloc_enabled()){+printk(KERN_WARNING"PCSP: CONFIG_DEBUG_PAGEALLOC is enabled, "+"which may make the sound noisy.\n");+}return0;}
--
1.9.1
--
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>
From: Joonsoo Kim <hidden> Date: 2016-02-05 16:13:18
2016-02-05 7:18 GMT+09:00 David Rientjes [off-list ref]:
On Thu, 4 Feb 2016, Joonsoo Kim wrote:
quoted
We can disable debug_pagealloc processing even if the code is complied
with CONFIG_DEBUG_PAGEALLOC. This patch changes the code to query
whether it is enabled or not in runtime.
Signed-off-by: Joonsoo Kim <redacted>
I think the comment immediately before this code referencing
CONFIG_DEBUG_PAGEALLOC should be changed to refer to pagealloc debugging
being enabled.
Andrew kindly did it. Thanks, Andrew.
After that:
Acked-by: David Rientjes [off-list ref]
From: Chris Metcalf <hidden> Date: 2016-02-09 16:57:06
On 02/04/2016 12:56 AM, Joonsoo Kim wrote:
We can disable debug_pagealloc processing even if the code is complied
with CONFIG_DEBUG_PAGEALLOC. This patch changes the code to query
whether it is enabled or not in runtime.
Signed-off-by: Joonsoo Kim<redacted>
---
arch/tile/mm/init.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
Acked-by: Chris Metcalf <redacted>
Although I note a typo ("complied") in the git commit message.
--
Chris Metcalf, EZChip Semiconductor
http://www.ezchip.com