aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/memcontrol.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/memcontrol.h')
-rw-r--r--include/linux/memcontrol.h16
1 files changed, 13 insertions, 3 deletions
diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h
index 6ea9f919e888..7c95af8d552c 100644
--- a/include/linux/memcontrol.h
+++ b/include/linux/memcontrol.h
@@ -400,8 +400,8 @@ int memcg_cache_id(struct mem_cgroup *memcg);
400 400
401void memcg_update_array_size(int num_groups); 401void memcg_update_array_size(int num_groups);
402 402
403struct kmem_cache * 403struct kmem_cache *__memcg_kmem_get_cache(struct kmem_cache *cachep);
404__memcg_kmem_get_cache(struct kmem_cache *cachep, gfp_t gfp); 404void __memcg_kmem_put_cache(struct kmem_cache *cachep);
405 405
406int __memcg_charge_slab(struct kmem_cache *cachep, gfp_t gfp, int order); 406int __memcg_charge_slab(struct kmem_cache *cachep, gfp_t gfp, int order);
407void __memcg_uncharge_slab(struct kmem_cache *cachep, int order); 407void __memcg_uncharge_slab(struct kmem_cache *cachep, int order);
@@ -492,7 +492,13 @@ memcg_kmem_get_cache(struct kmem_cache *cachep, gfp_t gfp)
492 if (unlikely(fatal_signal_pending(current))) 492 if (unlikely(fatal_signal_pending(current)))
493 return cachep; 493 return cachep;
494 494
495 return __memcg_kmem_get_cache(cachep, gfp); 495 return __memcg_kmem_get_cache(cachep);
496}
497
498static __always_inline void memcg_kmem_put_cache(struct kmem_cache *cachep)
499{
500 if (memcg_kmem_enabled())
501 __memcg_kmem_put_cache(cachep);
496} 502}
497#else 503#else
498#define for_each_memcg_cache_index(_idx) \ 504#define for_each_memcg_cache_index(_idx) \
@@ -528,6 +534,10 @@ memcg_kmem_get_cache(struct kmem_cache *cachep, gfp_t gfp)
528{ 534{
529 return cachep; 535 return cachep;
530} 536}
537
538static inline void memcg_kmem_put_cache(struct kmem_cache *cachep)
539{
540}
531#endif /* CONFIG_MEMCG_KMEM */ 541#endif /* CONFIG_MEMCG_KMEM */
532#endif /* _LINUX_MEMCONTROL_H */ 542#endif /* _LINUX_MEMCONTROL_H */
533 543