mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-09 20:32:04 +09:00
UPSTREAM: 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>
Bug: 64145065
(cherry-picked from 40323278b5)
Change-Id: I4a7dbd40b6a2eb777439f271fa600b201e6db1d3
Signed-off-by: Paul Lawrence <paullawrence@google.com>
This commit is contained in:
committed by
Paul Lawrence
parent
511f370eed
commit
118cb473e1
@@ -2180,7 +2180,6 @@ __kmem_cache_create (struct kmem_cache *cachep, unsigned long flags)
|
||||
else
|
||||
size += BYTES_PER_WORD;
|
||||
}
|
||||
#if FORCED_DEBUG && defined(CONFIG_DEBUG_PAGEALLOC)
|
||||
/*
|
||||
* To activate debug pagealloc, off-slab management is necessary
|
||||
* requirement. In early phase of initialization, small sized slab
|
||||
@@ -2188,14 +2187,13 @@ __kmem_cache_create (struct kmem_cache *cachep, unsigned long flags)
|
||||
* to check size >= 256. It guarantees that all necessary small
|
||||
* sized slab is initialized in current slab initialization sequence.
|
||||
*/
|
||||
if (debug_pagealloc_enabled() &&
|
||||
if (debug_pagealloc_enabled() && (flags & SLAB_POISON) &&
|
||||
!slab_early_init && size >= kmalloc_size(INDEX_NODE) &&
|
||||
size >= 256 && cachep->object_size > cache_line_size() &&
|
||||
ALIGN(size, cachep->align) < PAGE_SIZE) {
|
||||
cachep->obj_offset += PAGE_SIZE - ALIGN(size, cachep->align);
|
||||
size = PAGE_SIZE;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user