Skip to content

Commit a4d3f89

Browse files
Liu Xiangtorvalds
authored andcommitted
slub: remove useless kmem_cache_debug() before remove_full()
When CONFIG_SLUB_DEBUG is not enabled, remove_full() is empty. While CONFIG_SLUB_DEBUG is enabled, remove_full() can check s->flags by itself. So kmem_cache_debug() is useless and can be removed. Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Liu Xiang <[email protected]> Acked-by: David Rientjes <[email protected]> Cc: Christoph Lameter <[email protected]> Cc: Pekka Enberg <[email protected]> Cc: Joonsoo Kim <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 3e05617 commit a4d3f89

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

mm/slub.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2903,8 +2903,7 @@ static void __slab_free(struct kmem_cache *s, struct page *page,
29032903
* then add it.
29042904
*/
29052905
if (!kmem_cache_has_cpu_partial(s) && unlikely(!prior)) {
2906-
if (kmem_cache_debug(s))
2907-
remove_full(s, n, page);
2906+
remove_full(s, n, page);
29082907
add_partial(n, page, DEACTIVATE_TO_TAIL);
29092908
stat(s, FREE_ADD_PARTIAL);
29102909
}

0 commit comments

Comments
 (0)