aboutsummaryrefslogtreecommitdiffstats
path: root/mm/memcontrol.c
diff options
context:
space:
mode:
authorWanpeng Li <liwp@linux.vnet.ibm.com>2012-07-31 19:43:23 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-07-31 21:42:44 -0400
commitaaad153e3408a4b8784de4c8446a40e70d57481f (patch)
tree2dadfd1998bec652dc6264f1380997407d3daeda /mm/memcontrol.c
parent05a73ed29a3aef4cf8d095ec5b08afecb959fa24 (diff)
mm/memcg: mem_cgroup_relize_xxx_limit can guarantee memcg->res.limit <= memcg->memsw.limit
Signed-off-by: Wanpeng Li <liwp.linux@gmail.com> Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> 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.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index b11fb2fe77c1..ac87e79b00d1 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -3416,7 +3416,7 @@ static int mem_cgroup_resize_limit(struct mem_cgroup *memcg,
3416 /* 3416 /*
3417 * Rather than hide all in some function, I do this in 3417 * Rather than hide all in some function, I do this in
3418 * open coded manner. You see what this really does. 3418 * open coded manner. You see what this really does.
3419 * We have to guarantee memcg->res.limit < memcg->memsw.limit. 3419 * We have to guarantee memcg->res.limit <= memcg->memsw.limit.
3420 */ 3420 */
3421 mutex_lock(&set_limit_mutex); 3421 mutex_lock(&set_limit_mutex);
3422 memswlimit = res_counter_read_u64(&memcg->memsw, RES_LIMIT); 3422 memswlimit = res_counter_read_u64(&memcg->memsw, RES_LIMIT);
@@ -3477,7 +3477,7 @@ static int mem_cgroup_resize_memsw_limit(struct mem_cgroup *memcg,
3477 /* 3477 /*
3478 * Rather than hide all in some function, I do this in 3478 * Rather than hide all in some function, I do this in
3479 * open coded manner. You see what this really does. 3479 * open coded manner. You see what this really does.
3480 * We have to guarantee memcg->res.limit < memcg->memsw.limit. 3480 * We have to guarantee memcg->res.limit <= memcg->memsw.limit.
3481 */ 3481 */
3482 mutex_lock(&set_limit_mutex); 3482 mutex_lock(&set_limit_mutex);
3483 memlimit = res_counter_read_u64(&memcg->res, RES_LIMIT); 3483 memlimit = res_counter_read_u64(&memcg->res, RES_LIMIT);