summaryrefslogtreecommitdiffstats
path: root/mm/slab.h
diff options
context:
space:
mode:
authorGlauber Costa <glommer@parallels.com>2012-12-18 14:22:27 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2012-12-18 15:02:13 -0800
commitba6c496ed834a37a26fc6fc87fc9aecb0fa0014d (patch)
treecd229b78ca04817354865c9fdf57b564a6bf7852 /mm/slab.h
parentd5bdae7d59451b9d63303f7794ef32bb76ba6330 (diff)
downloadlinux-ba6c496ed834a37a26fc6fc87fc9aecb0fa0014d.tar.gz
linux-ba6c496ed834a37a26fc6fc87fc9aecb0fa0014d.tar.bz2
linux-ba6c496ed834a37a26fc6fc87fc9aecb0fa0014d.zip
slab/slub: struct memcg_params
For the kmem slab controller, we need to record some extra information in the kmem_cache structure. Signed-off-by: Glauber Costa <glommer@parallels.com> Signed-off-by: Suleiman Souhlal <suleiman@google.com> Cc: Christoph Lameter <cl@linux.com> Cc: David Rientjes <rientjes@google.com> Cc: Frederic Weisbecker <fweisbec@redhat.com> Cc: Greg Thelen <gthelen@google.com> Cc: Johannes Weiner <hannes@cmpxchg.org> Cc: JoonSoo Kim <js1304@gmail.com> Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> Cc: Mel Gorman <mel@csn.ul.ie> Cc: Michal Hocko <mhocko@suse.cz> Cc: Pekka Enberg <penberg@cs.helsinki.fi> Cc: Rik van Riel <riel@redhat.com> Cc: Tejun Heo <tj@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/slab.h')
-rw-r--r--mm/slab.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/mm/slab.h b/mm/slab.h
index 1cb9c9ee0e6f..49e7a8b1d27e 100644
--- a/mm/slab.h
+++ b/mm/slab.h
@@ -100,4 +100,17 @@ void get_slabinfo(struct kmem_cache *s, struct slabinfo *sinfo);
void slabinfo_show_stats(struct seq_file *m, struct kmem_cache *s);
ssize_t slabinfo_write(struct file *file, const char __user *buffer,
size_t count, loff_t *ppos);
+
+#ifdef CONFIG_MEMCG_KMEM
+static inline bool is_root_cache(struct kmem_cache *s)
+{
+ return !s->memcg_params || s->memcg_params->is_root_cache;
+}
+#else
+static inline bool is_root_cache(struct kmem_cache *s)
+{
+ return true;
+}
+
+#endif
#endif