Skip to content

Commit

Permalink
slub: add missed accounting
Browse files Browse the repository at this point in the history
With per-cpu partial list, slab is added to partial list first and then moved
to node list. The __slab_free() code path for add/remove_partial is almost
deprecated(except for slub debug). But we forget to account add/remove_partial
when move per-cpu partial pages to node list, so the statistics for such events
are always 0. Add corresponding accounting.

This is against the patch "slub: use correct parameter to add a page to
partial list tail"

Acked-by: Christoph Lameter <[email protected]>
Signed-off-by: Shaohua Li <[email protected]>
Signed-off-by: Pekka Enberg <[email protected]>
  • Loading branch information
Shaohua Li authored and penberg committed Dec 13, 2011
1 parent 8f1e33d commit b13683d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions mm/slub.c
Original file line number Diff line number Diff line change
Expand Up @@ -1901,11 +1901,14 @@ static void unfreeze_partials(struct kmem_cache *s)
}

if (l != m) {
if (l == M_PARTIAL)
if (l == M_PARTIAL) {
remove_partial(n, page);
else
stat(s, FREE_REMOVE_PARTIAL);
} else {
add_partial(n, page,
DEACTIVATE_TO_TAIL);
stat(s, FREE_ADD_PARTIAL);
}

l = m;
}
Expand Down

0 comments on commit b13683d

Please sign in to comment.