slab: link memcg caches of the same kind into a list
authorVladimir Davydov <[email protected]>
Thu, 12 Feb 2015 22:59:23 +0000 (14:59 -0800)
committerLinus Torvalds <[email protected]>
Fri, 13 Feb 2015 02:54:09 +0000 (18:54 -0800)
commit426589f571f7d6d5ab2ca33ece73164149279ca1
tree9b9c94fad5bd7bb8330d8c9b4c510479b75c5588
parentf7ce3190c4a35bf887adb7a1aa1ba899b679872d
slab: link memcg caches of the same kind into a list

Sometimes, we need to iterate over all memcg copies of a particular root
kmem cache.  Currently, we use memcg_cache_params->memcg_caches array for
that, because it contains all existing memcg caches.

However, it's a bad practice to keep all caches, including those that
belong to offline cgroups, in this array, because it will be growing
beyond any bounds then.  I'm going to wipe away dead caches from it to
save space.  To still be able to perform iterations over all memcg caches
of the same kind, let us link them into a list.

Signed-off-by: Vladimir Davydov <[email protected]>
Cc: Johannes Weiner <[email protected]>
Cc: Michal Hocko <[email protected]>
Cc: Tejun Heo <[email protected]>
Cc: Christoph Lameter <[email protected]>
Cc: Pekka Enberg <[email protected]>
Cc: David Rientjes <[email protected]>
Cc: Joonsoo Kim <[email protected]>
Cc: Dave Chinner <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
include/linux/slab.h
mm/slab.c
mm/slab.h
mm/slab_common.c
mm/slub.c