]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
memcg: soft limit reclaim should end at limit not below
authorJohannes Weiner <hannes@cmpxchg.org>
Wed, 23 Mar 2011 23:42:20 +0000 (16:42 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 24 Mar 2011 02:46:23 +0000 (19:46 -0700)
Soft limit reclaim continues until the usage is below the current soft
limit, but the documented semantics are actually that soft limit reclaim
will push usage back until the soft limits are met again.

Signed-off-by: Johannes Weiner <hannes@cmpxchg.org>
Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp>
Acked-by: Balbir Singh <balbir@linux.vnet.ibm.com>
Cc: Minchan Kim <minchan.kim@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
include/linux/res_counter.h
mm/memcontrol.c

index a5930cb6614577517223ba642854b78ba339197b..bf1f01bc013f4ccf6e6e3d2b3d79bc455226aeb0 100644 (file)
@@ -139,7 +139,7 @@ static inline bool res_counter_limit_check_locked(struct res_counter *cnt)
 
 static inline bool res_counter_soft_limit_check_locked(struct res_counter *cnt)
 {
-       if (cnt->usage < cnt->soft_limit)
+       if (cnt->usage <= cnt->soft_limit)
                return true;
 
        return false;
@@ -202,7 +202,7 @@ static inline bool res_counter_check_margin(struct res_counter *cnt,
        return ret;
 }
 
-static inline bool res_counter_check_under_soft_limit(struct res_counter *cnt)
+static inline bool res_counter_check_within_soft_limit(struct res_counter *cnt)
 {
        bool ret;
        unsigned long flags;
index b56bd74b486fb539e6e893151b0e0af42395444a..13de53fe0108ecdb8584e570ae5b5f434bb1451e 100644 (file)
@@ -1477,7 +1477,7 @@ static int mem_cgroup_hierarchical_reclaim(struct mem_cgroup *root_mem,
                        return ret;
                total += ret;
                if (check_soft) {
-                       if (res_counter_check_under_soft_limit(&root_mem->res))
+                       if (res_counter_check_within_soft_limit(&root_mem->res))
                                return total;
                } else if (mem_cgroup_check_under_limit(root_mem))
                        return 1 + total;