aboutsummaryrefslogtreecommitdiffstats
path: root/mm/memcontrol.c
diff options
context:
space:
mode:
authorVladimir Davydov <vdavydov@parallels.com>2014-04-07 18:39:26 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-04-07 19:36:12 -0400
commit794b1248be4e7e157f5535c3ee49168aa4643349 (patch)
tree93bfa09b76abff9ec2f9d154bb43971bcce2f574 /mm/memcontrol.c
parent5722d094ad2b56fa2c1cb3adaf40071a55bbf242 (diff)
memcg, slab: separate memcg vs root cache creation paths
Memcg-awareness turned kmem_cache_create() into a dirty interweaving of memcg-only and except-for-memcg calls. To clean this up, let's move the code responsible for memcg cache creation to a separate function. Signed-off-by: Vladimir Davydov <vdavydov@parallels.com> Cc: Michal Hocko <mhocko@suse.cz> Cc: Johannes Weiner <hannes@cmpxchg.org> Cc: David Rientjes <rientjes@google.com> Cc: Pekka Enberg <penberg@kernel.org> Cc: Glauber Costa <glommer@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/memcontrol.c')
-rw-r--r--mm/memcontrol.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index 32c7342df4bf..451523c3bd4e 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -3395,13 +3395,8 @@ static void memcg_create_cache_work_func(struct work_struct *w)
3395 struct create_work *cw = container_of(w, struct create_work, work); 3395 struct create_work *cw = container_of(w, struct create_work, work);
3396 struct mem_cgroup *memcg = cw->memcg; 3396 struct mem_cgroup *memcg = cw->memcg;
3397 struct kmem_cache *cachep = cw->cachep; 3397 struct kmem_cache *cachep = cw->cachep;
3398 struct kmem_cache *new;
3399 3398
3400 new = kmem_cache_create_memcg(memcg, cachep->name, 3399 kmem_cache_create_memcg(memcg, cachep);
3401 cachep->object_size, cachep->align,
3402 cachep->flags & ~SLAB_PANIC, cachep->ctor, cachep);
3403 if (new)
3404 new->allocflags |= __GFP_KMEMCG;
3405 css_put(&memcg->css); 3400 css_put(&memcg->css);
3406 kfree(cw); 3401 kfree(cw);
3407} 3402}