diff --git a/mm/slub.c b/mm/slub.c index 011e53e5845b..36c0befeebd8 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -2131,26 +2131,15 @@ static void deactivate_slab(struct kmem_cache *s, struct page *page, } if (l != m) { - if (l == M_PARTIAL) - remove_partial(n, page); - else if (l == M_FULL) - remove_full(s, n, page); - if (m == M_PARTIAL) { - + if (m == M_PARTIAL) add_partial(n, page, tail); - stat(s, tail); - - } else if (m == M_FULL) { - - stat(s, DEACTIVATE_FULL); + else if (m == M_FULL) add_full(s, n, page); - - } } l = m; @@ -2163,7 +2152,11 @@ static void deactivate_slab(struct kmem_cache *s, struct page *page, if (lock) spin_unlock(&n->list_lock); - if (m == M_FREE) { + if (m == M_PARTIAL) + stat(s, tail); + else if (m == M_FULL) + stat(s, DEACTIVATE_FULL); + else if (m == M_FREE) { stat(s, DEACTIVATE_EMPTY); discard_slab(s, page); stat(s, FREE_SLAB);