diff options
author | Vladimir Davydov <vdavydov@parallels.com> | 2014-12-10 18:43:48 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-12-10 20:41:07 -0500 |
commit | 8c0145b62ef7e9019ab39284ed88873c483c8003 (patch) | |
tree | f3d6f223f04dd075b44d0e5a63848b28a8a755d1 /mm/memcontrol.c | |
parent | 7d5e324573b0ffd7098ab880c82096ca29a11f7f (diff) |
memcg: remove activate_kmem_mutex
The activate_kmem_mutex is used to serialize memcg.kmem.limit updates, but
we already serialize them with memcg_limit_mutex so let's remove the
former.
Signed-off-by: Vladimir Davydov <vdavydov@parallels.com>
Acked-by: Johannes Weiner <hannes@cmpxchg.org>
Acked-by: Michal Hocko <mhocko@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/memcontrol.c')
-rw-r--r-- | mm/memcontrol.c | 24 |
1 files changed, 5 insertions, 19 deletions
diff --git a/mm/memcontrol.c b/mm/memcontrol.c index a0ae64ca55bf..420461bcaefd 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c | |||
@@ -2627,8 +2627,6 @@ static void commit_charge(struct page *page, struct mem_cgroup *memcg, | |||
2627 | */ | 2627 | */ |
2628 | static DEFINE_MUTEX(memcg_slab_mutex); | 2628 | static DEFINE_MUTEX(memcg_slab_mutex); |
2629 | 2629 | ||
2630 | static DEFINE_MUTEX(activate_kmem_mutex); | ||
2631 | |||
2632 | /* | 2630 | /* |
2633 | * This is a bit cumbersome, but it is rarely used and avoids a backpointer | 2631 | * This is a bit cumbersome, but it is rarely used and avoids a backpointer |
2634 | * in the memcg_cache_params struct. | 2632 | * in the memcg_cache_params struct. |
@@ -3747,9 +3745,8 @@ static u64 mem_cgroup_read_u64(struct cgroup_subsys_state *css, | |||
3747 | } | 3745 | } |
3748 | 3746 | ||
3749 | #ifdef CONFIG_MEMCG_KMEM | 3747 | #ifdef CONFIG_MEMCG_KMEM |
3750 | /* should be called with activate_kmem_mutex held */ | 3748 | static int memcg_activate_kmem(struct mem_cgroup *memcg, |
3751 | static int __memcg_activate_kmem(struct mem_cgroup *memcg, | 3749 | unsigned long nr_pages) |
3752 | unsigned long nr_pages) | ||
3753 | { | 3750 | { |
3754 | int err = 0; | 3751 | int err = 0; |
3755 | int memcg_id; | 3752 | int memcg_id; |
@@ -3811,17 +3808,6 @@ out: | |||
3811 | return err; | 3808 | return err; |
3812 | } | 3809 | } |
3813 | 3810 | ||
3814 | static int memcg_activate_kmem(struct mem_cgroup *memcg, | ||
3815 | unsigned long nr_pages) | ||
3816 | { | ||
3817 | int ret; | ||
3818 | |||
3819 | mutex_lock(&activate_kmem_mutex); | ||
3820 | ret = __memcg_activate_kmem(memcg, nr_pages); | ||
3821 | mutex_unlock(&activate_kmem_mutex); | ||
3822 | return ret; | ||
3823 | } | ||
3824 | |||
3825 | static int memcg_update_kmem_limit(struct mem_cgroup *memcg, | 3811 | static int memcg_update_kmem_limit(struct mem_cgroup *memcg, |
3826 | unsigned long limit) | 3812 | unsigned long limit) |
3827 | { | 3813 | { |
@@ -3844,14 +3830,14 @@ static int memcg_propagate_kmem(struct mem_cgroup *memcg) | |||
3844 | if (!parent) | 3830 | if (!parent) |
3845 | return 0; | 3831 | return 0; |
3846 | 3832 | ||
3847 | mutex_lock(&activate_kmem_mutex); | 3833 | mutex_lock(&memcg_limit_mutex); |
3848 | /* | 3834 | /* |
3849 | * If the parent cgroup is not kmem-active now, it cannot be activated | 3835 | * If the parent cgroup is not kmem-active now, it cannot be activated |
3850 | * after this point, because it has at least one child already. | 3836 | * after this point, because it has at least one child already. |
3851 | */ | 3837 | */ |
3852 | if (memcg_kmem_is_active(parent)) | 3838 | if (memcg_kmem_is_active(parent)) |
3853 | ret = __memcg_activate_kmem(memcg, PAGE_COUNTER_MAX); | 3839 | ret = memcg_activate_kmem(memcg, PAGE_COUNTER_MAX); |
3854 | mutex_unlock(&activate_kmem_mutex); | 3840 | mutex_unlock(&memcg_limit_mutex); |
3855 | return ret; | 3841 | return ret; |
3856 | } | 3842 | } |
3857 | #else | 3843 | #else |