From: Vladimir Davydov Date: Thu, 9 Oct 2014 22:28:45 +0000 (-0700) Subject: memcg: don't call memcg_update_all_caches if new cache id fits X-Git-Tag: omap-for-v3.19/prcm-cleanup~134^2~47 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f3bb3043a092368a255bca5d1c6f4352c96a3b2d;p=pandora-kernel.git memcg: don't call memcg_update_all_caches if new cache id fits memcg_update_all_caches grows arrays of per-memcg caches, so we only need to call it when memcg_limited_groups_array_size is increased. However, currently we invoke it each time a new kmem-active memory cgroup is created. Then it just iterates over all slab_caches and does nothing (memcg_update_cache_size returns immediately). This patch fixes this insanity. In the meantime it moves the code dealing with id allocations to separate functions, memcg_alloc_cache_id and memcg_free_cache_id. Signed-off-by: Vladimir Davydov Cc: Johannes Weiner Acked-by: Michal Hocko Cc: Christoph Lameter Cc: Glauber Costa Cc: Joonsoo Kim Cc: David Rientjes Cc: Pekka Enberg Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- Reading git-diff-tree failed