aboutsummaryrefslogtreecommitdiffstats
path: root/mm/memcontrol.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/memcontrol.c')
-rw-r--r--mm/memcontrol.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index afa55bb38cbd..6f3c0fcd7a2d 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -332,7 +332,7 @@ struct mem_cgroup {
332 struct cg_proto tcp_mem; 332 struct cg_proto tcp_mem;
333#endif 333#endif
334#if defined(CONFIG_MEMCG_KMEM) 334#if defined(CONFIG_MEMCG_KMEM)
335 /* Index in the kmem_cache->memcg_params->memcg_caches array */ 335 /* Index in the kmem_cache->memcg_params.memcg_caches array */
336 int kmemcg_id; 336 int kmemcg_id;
337#endif 337#endif
338 338
@@ -531,7 +531,7 @@ static void disarm_sock_keys(struct mem_cgroup *memcg)
531 531
532#ifdef CONFIG_MEMCG_KMEM 532#ifdef CONFIG_MEMCG_KMEM
533/* 533/*
534 * This will be the memcg's index in each cache's ->memcg_params->memcg_caches. 534 * This will be the memcg's index in each cache's ->memcg_params.memcg_caches.
535 * The main reason for not using cgroup id for this: 535 * The main reason for not using cgroup id for this:
536 * this works better in sparse environments, where we have a lot of memcgs, 536 * this works better in sparse environments, where we have a lot of memcgs,
537 * but only a few kmem-limited. Or also, if we have, for instance, 200 537 * but only a few kmem-limited. Or also, if we have, for instance, 200
@@ -2667,8 +2667,7 @@ struct kmem_cache *__memcg_kmem_get_cache(struct kmem_cache *cachep)
2667 struct mem_cgroup *memcg; 2667 struct mem_cgroup *memcg;
2668 struct kmem_cache *memcg_cachep; 2668 struct kmem_cache *memcg_cachep;
2669 2669
2670 VM_BUG_ON(!cachep->memcg_params); 2670 VM_BUG_ON(!is_root_cache(cachep));
2671 VM_BUG_ON(!cachep->memcg_params->is_root_cache);
2672 2671
2673 if (current->memcg_kmem_skip_account) 2672 if (current->memcg_kmem_skip_account)
2674 return cachep; 2673 return cachep;
@@ -2702,7 +2701,7 @@ out:
2702void __memcg_kmem_put_cache(struct kmem_cache *cachep) 2701void __memcg_kmem_put_cache(struct kmem_cache *cachep)
2703{ 2702{
2704 if (!is_root_cache(cachep)) 2703 if (!is_root_cache(cachep))
2705 css_put(&cachep->memcg_params->memcg->css); 2704 css_put(&cachep->memcg_params.memcg->css);
2706} 2705}
2707 2706
2708/* 2707/*
@@ -2778,7 +2777,7 @@ struct mem_cgroup *__mem_cgroup_from_kmem(void *ptr)
2778 if (PageSlab(page)) { 2777 if (PageSlab(page)) {
2779 cachep = page->slab_cache; 2778 cachep = page->slab_cache;
2780 if (!is_root_cache(cachep)) 2779 if (!is_root_cache(cachep))
2781 memcg = cachep->memcg_params->memcg; 2780 memcg = cachep->memcg_params.memcg;
2782 } else 2781 } else
2783 /* page allocated by alloc_kmem_pages */ 2782 /* page allocated by alloc_kmem_pages */
2784 memcg = page->mem_cgroup; 2783 memcg = page->mem_cgroup;