Messages in this thread Patch in this message | | | Date | Fri, 21 Nov 2008 19:03:39 +0900 | From | KAMEZAWA Hiroyuki <> | 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; }
| |