aboutsummaryrefslogtreecommitdiffstats
path: root/mm/slab.c
diff options
context:
space:
mode:
authorJoonsoo Kim <iamjoonsoo.kim@lge.com>2016-03-15 17:54:18 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2016-03-15 19:55:16 -0400
commit40323278b557a5909bbecfa181c91a3af7afbbe3 (patch)
treee26be3f9928412178c03beffa59d5f679c161fef /mm/slab.c
parenta307ebd468e0b97c203f5a99a56a6017e4d1991a (diff)
mm/slab: use more appropriate condition check for debug_pagealloc
debug_pagealloc debugging is related to SLAB_POISON flag rather than FORCED_DEBUG option, although FORCED_DEBUG option will enable SLAB_POISON. Fix it. Signed-off-by: Joonsoo Kim <iamjoonsoo.kim@lge.com> Acked-by: Christoph Lameter <cl@linux.com> Cc: Pekka Enberg <penberg@kernel.org> Cc: David Rientjes <rientjes@google.com> Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com> Cc: Jesper Dangaard Brouer <brouer@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/slab.c')
-rw-r--r--mm/slab.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/mm/slab.c b/mm/slab.c
index 4807cf4fe1b4..8bca9be5d557 100644
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -2169,7 +2169,6 @@ __kmem_cache_create (struct kmem_cache *cachep, unsigned long flags)
2169 else 2169 else
2170 size += BYTES_PER_WORD; 2170 size += BYTES_PER_WORD;
2171 } 2171 }
2172#if FORCED_DEBUG && defined(CONFIG_DEBUG_PAGEALLOC)
2173 /* 2172 /*
2174 * To activate debug pagealloc, off-slab management is necessary 2173 * To activate debug pagealloc, off-slab management is necessary
2175 * requirement. In early phase of initialization, small sized slab 2174 * requirement. In early phase of initialization, small sized slab
@@ -2177,7 +2176,7 @@ __kmem_cache_create (struct kmem_cache *cachep, unsigned long flags)
2177 * to check size >= 256. It guarantees that all necessary small 2176 * to check size >= 256. It guarantees that all necessary small
2178 * sized slab is initialized in current slab initialization sequence. 2177 * sized slab is initialized in current slab initialization sequence.
2179 */ 2178 */
2180 if (debug_pagealloc_enabled() && 2179 if (debug_pagealloc_enabled() && (flags & SLAB_POISON) &&
2181 !slab_early_init && size >= kmalloc_size(INDEX_NODE) && 2180 !slab_early_init && size >= kmalloc_size(INDEX_NODE) &&
2182 size >= 256 && cachep->object_size > cache_line_size() && 2181 size >= 256 && cachep->object_size > cache_line_size() &&
2183 ALIGN(size, cachep->align) < PAGE_SIZE) { 2182 ALIGN(size, cachep->align) < PAGE_SIZE) {
@@ -2185,7 +2184,6 @@ __kmem_cache_create (struct kmem_cache *cachep, unsigned long flags)
2185 size = PAGE_SIZE; 2184 size = PAGE_SIZE;
2186 } 2185 }
2187#endif 2186#endif
2188#endif
2189 2187
2190 /* 2188 /*
2191 * Determine if the slab management is 'on' or 'off' slab. 2189 * Determine if the slab management is 'on' or 'off' slab.