summaryrefslogtreecommitdiffstats
path: root/mm/slub.c
diff options
context:
space:
mode:
authorJoonsoo Kim <iamjoonsoo.kim@lge.com>2016-03-17 17:17:53 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2016-03-17 18:09:34 -0400
commit922d566cdcb7166c729ff67bb15ff5f93a3774b6 (patch)
tree88e23a5a52aa8286fe904725300c0ff0ae4e0f70 /mm/slub.c
parentf48d97f340cbb0c323fa7a7b36bd76a108a9f49f (diff)
mm/slub: query dynamic DEBUG_PAGEALLOC setting
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. [akpm@linux-foundation.org: clean up code, per Christian] Signed-off-by: Joonsoo Kim <iamjoonsoo.kim@lge.com> Reviewed-by: Christian Borntraeger <borntraeger@de.ibm.com> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Chris Metcalf <cmetcalf@ezchip.com> Cc: Christoph Lameter <cl@linux.com> Cc: David Rientjes <rientjes@google.com> Cc: Pekka Enberg <penberg@kernel.org> Cc: Takashi Iwai <tiwai@suse.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/slub.c')
-rw-r--r--mm/slub.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/mm/slub.c b/mm/slub.c
index 712d53474082..2f2f04d39104 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -254,11 +254,10 @@ static inline void *get_freepointer_safe(struct kmem_cache *s, void *object)
254{ 254{
255 void *p; 255 void *p;
256 256
257#ifdef CONFIG_DEBUG_PAGEALLOC 257 if (!debug_pagealloc_enabled())
258 return get_freepointer(s, object);
259
258 probe_kernel_read(&p, (void **)(object + s->offset), sizeof(p)); 260 probe_kernel_read(&p, (void **)(object + s->offset), sizeof(p));
259#else
260 p = get_freepointer(s, object);
261#endif
262 return p; 261 return p;
263} 262}
264 263