[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20081121190339.65f453a6.kamezawa.hiroyu@jp.fujitsu.com>
Date: Fri, 21 Nov 2008 19:03:39 +0900
From: KAMEZAWA Hiroyuki <kamezawa.hiroyu@...fujitsu.com>
To: KAMEZAWA Hiroyuki <kamezawa.hiroyu@...fujitsu.com>
Cc: Li Zefan <lizf@...fujitsu.com>,
"linux-mm@...ck.org" <linux-mm@...ck.org>,
"balbir@...ux.vnet.ibm.com" <balbir@...ux.vnet.ibm.com>,
"nishimura@....nes.nec.co.jp" <nishimura@....nes.nec.co.jp>,
pbadari@...ibm.com, jblunck@...e.de, taka@...inux.co.jp,
"akpm@...ux-foundation.org" <akpm@...ux-foundation.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
npiggin@...e.de
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@...fujitsu.com>
Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@...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;
}
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists