diff options
author | KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> | 2009-01-07 21:08:09 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-01-08 11:31:06 -0500 |
commit | 887007561ae58628f03aa9046949747c04f63be8 (patch) | |
tree | 2cc7e5b3028070303121457bc63dd155df2158b4 /mm | |
parent | a636b327f731143ccc544b966cfd8de6cb6d72c6 (diff) |
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>
Cc: Balbir Singh <balbir@in.ibm.com>
Cc: Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp>
Cc: Badari Pulavarty <pbadari@us.ibm.com>
Cc: Jan Blunck <jblunck@suse.de>
Cc: Hirokazu Takahashi <taka@valinux.co.jp>
Cc: Nick Piggin <nickpiggin@yahoo.com.au>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm')
-rw-r--r-- | mm/memcontrol.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 659b0c58f13e..9bf5d7c8ede7 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c | |||
@@ -709,17 +709,17 @@ static int __mem_cgroup_try_charge(struct mm_struct *mm, | |||
709 | * current usage of the cgroup before giving up | 709 | * current usage of the cgroup before giving up |
710 | * | 710 | * |
711 | */ | 711 | */ |
712 | if (!do_swap_account && | 712 | if (do_swap_account) { |
713 | res_counter_check_under_limit(&mem->res)) | 713 | if (res_counter_check_under_limit(&mem_over_limit->res) && |
714 | continue; | 714 | res_counter_check_under_limit(&mem_over_limit->memsw)) |
715 | if (do_swap_account && | 715 | continue; |
716 | res_counter_check_under_limit(&mem->memsw)) | 716 | } else if (res_counter_check_under_limit(&mem_over_limit->res)) |
717 | continue; | 717 | continue; |
718 | 718 | ||
719 | if (!nr_retries--) { | 719 | if (!nr_retries--) { |
720 | if (oom) { | 720 | if (oom) { |
721 | mem_cgroup_out_of_memory(mem, gfp_mask); | 721 | mem_cgroup_out_of_memory(mem_over_limit, gfp_mask); |
722 | mem->last_oom_jiffies = jiffies; | 722 | mem_over_limit->last_oom_jiffies = jiffies; |
723 | } | 723 | } |
724 | goto nomem; | 724 | goto nomem; |
725 | } | 725 | } |