Commit 68eb11db authored by Roman Gushchin's avatar Roman Gushchin Committed by Stephen Rothwell
Browse files

mm: slub: call account_slab_page() after slab page initialization

It's convenient to have page->objects initialized before calling into
account_slab_page().  In particular, this information can be used to
pre-alloc the obj_cgroup vector.

Let's call account_slab_page() a bit later, after the initialization of

This commit doesn't bring any functional change, but is required for
further optimizations.


Signed-off-by: default avatarRoman Gushchin <>
Acked-by: default avatarJohannes Weiner <>
Cc: Shakeel Butt <>
Cc: Michal Hocko <>
Cc: Christoph Lameter <>
Signed-off-by: default avatarAndrew Morton <>
Signed-off-by: default avatarStephen Rothwell <>
parent 461b928a
......@@ -1622,9 +1622,6 @@ static inline struct page *alloc_slab_page(struct kmem_cache *s,
page = __alloc_pages_node(node, flags, order);
if (page)
account_slab_page(page, order, s);
return page;
......@@ -1777,6 +1774,8 @@ static struct page *allocate_slab(struct kmem_cache *s, gfp_t flags, int node)
page->objects = oo_objects(oo);
account_slab_page(page, oo_order(oo), s, flags);
page->slab_cache = s;
if (page_is_pfmemalloc(page))
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment