aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
Diffstat (limited to 'mm')
-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);
100void slabinfo_show_stats(struct seq_file *m, struct kmem_cache *s); 100void slabinfo_show_stats(struct seq_file *m, struct kmem_cache *s);
101ssize_t slabinfo_write(struct file *file, const char __user *buffer, 101ssize_t slabinfo_write(struct file *file, const char __user *buffer,
102 size_t count, loff_t *ppos); 102 size_t count, loff_t *ppos);
103
104#ifdef CONFIG_MEMCG_KMEM
105static inline bool is_root_cache(struct kmem_cache *s)
106{
107 return !s->memcg_params || s->memcg_params->is_root_cache;
108}
109#else
110static inline bool is_root_cache(struct kmem_cache *s)
111{
112 return true;
113}
114
115#endif
103#endif 116#endif