aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/res_counter.h
diff options
context:
space:
mode:
authorJohannes Weiner <hannes@cmpxchg.org>2011-03-23 19:42:20 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-03-23 22:46:23 -0400
commitb7c6167848fa36e32f1874b95c1edc02881cd040 (patch)
treed160acb871f2be4e0e7095c662b647e12a199dac /include/linux/res_counter.h
parent56039efa18f2530fc23e8ef19e716b65ee2a1d1e (diff)
memcg: soft limit reclaim should end at limit not below
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>
Diffstat (limited to 'include/linux/res_counter.h')
-rw-r--r--include/linux/res_counter.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/linux/res_counter.h b/include/linux/res_counter.h
index a5930cb66145..bf1f01bc013f 100644
--- a/include/linux/res_counter.h
+++ b/include/linux/res_counter.h
@@ -139,7 +139,7 @@ static inline bool res_counter_limit_check_locked(struct res_counter *cnt)
139 139
140static inline bool res_counter_soft_limit_check_locked(struct res_counter *cnt) 140static inline bool res_counter_soft_limit_check_locked(struct res_counter *cnt)
141{ 141{
142 if (cnt->usage < cnt->soft_limit) 142 if (cnt->usage <= cnt->soft_limit)
143 return true; 143 return true;
144 144
145 return false; 145 return false;
@@ -202,7 +202,7 @@ static inline bool res_counter_check_margin(struct res_counter *cnt,
202 return ret; 202 return ret;
203} 203}
204 204
205static inline bool res_counter_check_under_soft_limit(struct res_counter *cnt) 205static inline bool res_counter_check_within_soft_limit(struct res_counter *cnt)
206{ 206{
207 bool ret; 207 bool ret;
208 unsigned long flags; 208 unsigned long flags;