aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/slab.h
diff options
context:
space:
mode:
authorVladimir Davydov <vdavydov@parallels.com>2015-02-12 17:59:23 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2015-02-12 21:54:09 -0500
commit426589f571f7d6d5ab2ca33ece73164149279ca1 (patch)
tree9b9c94fad5bd7bb8330d8c9b4c510479b75c5588 /include/linux/slab.h
parentf7ce3190c4a35bf887adb7a1aa1ba899b679872d (diff)
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 <vdavydov@parallels.com> Cc: Johannes Weiner <hannes@cmpxchg.org> Cc: Michal Hocko <mhocko@suse.cz> Cc: Tejun Heo <tj@kernel.org> Cc: Christoph Lameter <cl@linux.com> Cc: Pekka Enberg <penberg@kernel.org> Cc: David Rientjes <rientjes@google.com> Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com> Cc: Dave Chinner <david@fromorbit.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/slab.h')
-rw-r--r--include/linux/slab.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/linux/slab.h b/include/linux/slab.h
index 1e03c11bbfbd..26d99f41b410 100644
--- a/include/linux/slab.h
+++ b/include/linux/slab.h
@@ -491,9 +491,13 @@ struct memcg_cache_array {
491 * 491 *
492 * @memcg: pointer to the memcg this cache belongs to 492 * @memcg: pointer to the memcg this cache belongs to
493 * @root_cache: pointer to the global, root cache, this cache was derived from 493 * @root_cache: pointer to the global, root cache, this cache was derived from
494 *
495 * Both root and child caches of the same kind are linked into a list chained
496 * through @list.
494 */ 497 */
495struct memcg_cache_params { 498struct memcg_cache_params {
496 bool is_root_cache; 499 bool is_root_cache;
500 struct list_head list;
497 union { 501 union {
498 struct memcg_cache_array __rcu *memcg_caches; 502 struct memcg_cache_array __rcu *memcg_caches;
499 struct { 503 struct {