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>
This commit is contained in:
Vladimir Davydov
2014-04-07 15:39:26 -07:00
committed by Linus Torvalds
parent 5722d094ad
commit 794b1248be
4 changed files with 113 additions and 97 deletions

View File

@ -638,12 +638,6 @@ static inline int memcg_cache_id(struct mem_cgroup *memcg)
return -1;
}
static inline char *memcg_create_cache_name(struct mem_cgroup *memcg,
struct kmem_cache *root_cache)
{
return NULL;
}
static inline int memcg_alloc_cache_params(struct mem_cgroup *memcg,
struct kmem_cache *s, struct kmem_cache *root_cache)
{