Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1331687

[PATCH v2 2/5] mm/slub: query dynamic DEBUG_PAGEALLOC setting

From js1304@gmail.com
Newsgroups linux.kernel
Subject [PATCH v2 2/5] mm/slub: query dynamic DEBUG_PAGEALLOC setting
Date 2016-02-11 05:10 +0100
Message-ID <r0QJQ-3vQ-11@gated-at.bofh.it> (permalink)
References <r0QJP-3vQ-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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: clean up code, per Christian.

Signed-off-by: Joonsoo Kim <iamjoonsoo.kim@lge.com>
---
 mm/slub.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/mm/slub.c b/mm/slub.c
index 606488b..a1874c2 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -250,11 +250,10 @@ static inline void *get_freepointer_safe(struct kmem_cache *s, void *object)
 {
 	void *p;
 
-#ifdef CONFIG_DEBUG_PAGEALLOC
+	if (!debug_pagealloc_enabled())
+		return get_freepointer(s, object);
+
 	probe_kernel_read(&p, (void **)(object + s->offset), sizeof(p));
-#else
-	p = get_freepointer(s, object);
-#endif
 	return p;
 }
 
-- 
1.9.1

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


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