Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1331690
| From | js1304@gmail.com |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH v2 1/5] mm/vmalloc: query dynamic DEBUG_PAGEALLOC setting |
| Date | 2016-02-11 05:10 +0100 |
| Message-ID | <r0QJQ-3vQ-17@gated-at.bofh.it> (permalink) |
| References | <r0QJP-3vQ-1@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
From: Joonsoo Kim <iamjoonsoo.kim@lge.com>
We can disable debug_pagealloc processing even if the code is compiled
with CONFIG_DEBUG_PAGEALLOC. This patch changes the code to query
whether it is enabled or not in runtime.
v2: update comment, per David.
adjust comment to use 80 cols, per Andrew.
Reviewed-by: Christian Borntraeger <borntraeger@de.ibm.com>
Acked-by: David Rientjes <rientjes@google.com>
Signed-off-by: Joonsoo Kim <iamjoonsoo.kim@lge.com>
---
mm/vmalloc.c | 25 ++++++++++++-------------
1 file changed, 12 insertions(+), 13 deletions(-)
diff --git a/mm/vmalloc.c b/mm/vmalloc.c
index fb42a5b..d4b2e34 100644
--- a/mm/vmalloc.c
+++ b/mm/vmalloc.c
@@ -531,22 +531,21 @@ static void unmap_vmap_area(struct vmap_area *va)
static void vmap_debug_free_range(unsigned long start, unsigned long end)
{
/*
- * Unmap page tables and force a TLB flush immediately if
- * CONFIG_DEBUG_PAGEALLOC is set. This catches use after free
- * bugs similarly to those in linear kernel virtual address
- * space after a page has been freed.
+ * Unmap page tables and force a TLB flush immediately if pagealloc
+ * debugging is enabled. This catches use after free bugs similarly to
+ * those in linear kernel virtual address space after a page has been
+ * freed.
*
- * All the lazy freeing logic is still retained, in order to
- * minimise intrusiveness of this debugging feature.
+ * All the lazy freeing logic is still retained, in order to minimise
+ * intrusiveness of this debugging feature.
*
- * This is going to be *slow* (linear kernel virtual address
- * debugging doesn't do a broadcast TLB flush so it is a lot
- * faster).
+ * This is going to be *slow* (linear kernel virtual address debugging
+ * doesn't do a broadcast TLB flush so it is a lot 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
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
[PATCH v2 0/5] follow-up "Optimize CONFIG_DEBUG_PAGEALLOC" js1304@gmail.com - 2016-02-11 05:10 +0100
[PATCH v2 3/5] sound: query dynamic DEBUG_PAGEALLOC setting js1304@gmail.com - 2016-02-11 05:10 +0100
[PATCH v2 2/5] mm/slub: query dynamic DEBUG_PAGEALLOC setting js1304@gmail.com - 2016-02-11 05:10 +0100
Re: [PATCH v2 2/5] mm/slub: query dynamic DEBUG_PAGEALLOC setting Christian Borntraeger <borntraeger@de.ibm.com> - 2016-02-11 13:30 +0100
[PATCH v2 4/5] powerpc: query dynamic DEBUG_PAGEALLOC setting js1304@gmail.com - 2016-02-11 05:10 +0100
[PATCH v2 5/5] tile: query dynamic DEBUG_PAGEALLOC setting js1304@gmail.com - 2016-02-11 05:10 +0100
[PATCH v2 1/5] mm/vmalloc: query dynamic DEBUG_PAGEALLOC setting js1304@gmail.com - 2016-02-11 05:10 +0100
csiph-web