lkml.org 
[lkml]   [2008]   [Nov]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH 2/2] memcg: fix reclaim result checks.
check_under_limit logic was wrong and this check should be against
mem_over_limit rather than mem.

Reported-by: Li Zefan <lizf@cn.fujitsu.com>
Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
---
mm/memcontrol.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)

Index: mmotm-2.6.28-Nov20/mm/memcontrol.c
===================================================================
--- mmotm-2.6.28-Nov20.orig/mm/memcontrol.c
+++ mmotm-2.6.28-Nov20/mm/memcontrol.c
@@ -714,17 +714,17 @@ static int __mem_cgroup_try_charge(struc
* current usage of the cgroup before giving up
*
*/
- if (!do_swap_account &&
- res_counter_check_under_limit(&mem->res))
- continue;
- if (do_swap_account &&
- res_counter_check_under_limit(&mem->memsw))
- continue;
+ if (do_swap_account) {
+ if (res_counter_check_under_limit(&mem_over_limit->res) &&
+ res_counter_check_under_limit(&mem_over_limit->memsw))
+ continue;
+ } else if (res_counter_check_under_limit(&mem_over_limit->res))
+ continue;

if (!nr_retries--) {
if (oom) {
- mem_cgroup_out_of_memory(mem, gfp_mask);
- mem->last_oom_jiffies = jiffies;
+ mem_cgroup_out_of_memory(mem_over_limit, gfp_mask);
+ mem_over_limit->last_oom_jiffies = jiffies;
}
goto nomem;
}


\
 
 \ /
  Last update: 2008-11-21 11:07    [W:0.057 / U:0.156 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site