• Vladimir Davydov's avatar
    memcg, slab: cleanup memcg cache creation · 5722d094
    Vladimir Davydov authored
    This patch cleans up the memcg cache creation path as follows:
    
    - Move memcg cache name creation to a separate function to be called
      from kmem_cache_create_memcg().  This allows us to get rid of the mutex
      protecting the temporary buffer used for the name formatting, because
      the whole cache creation path is protected by the slab_mutex.
    
    - Get rid of memcg_create_kmem_cache().  This function serves as a proxy
      to kmem_cache_create_memcg().  After separating the cache name creation
      path, it would be reduced to a function call, so let's inline it.
    Signed-off-by: default avatarVladimir 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: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    5722d094
slab_common.c 16.3 KB