diff options
author | KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> | 2011-06-15 18:08:46 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-06-15 23:04:01 -0400 |
commit | fbc29a25e484be073e7d762c9f7f1d4bf8aecc48 (patch) | |
tree | 276a9e1e0c3d8f653dd821c049ec4b6940a06c1d /mm/memcontrol.c | |
parent | 26fe616844491a41a1abc02e29f7a9d1ec2f8ddb (diff) |
memcg: avoid percpu cached charge draining at softlimit
Based on Michal Hocko's comment.
We are not draining per cpu cached charges during soft limit reclaim
because background reclaim doesn't care about charges. It tries to free
some memory and charges will not give any.
Cached charges might influence only selection of the biggest soft limit
offender but as the call is done only after the selection has been already
done it makes no change.
Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp>
Reviewed-by: Michal Hocko <mhocko@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/memcontrol.c')
-rw-r--r-- | mm/memcontrol.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/mm/memcontrol.c b/mm/memcontrol.c index c39a177bb641..cf7d027a8844 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c | |||
@@ -1670,7 +1670,13 @@ static int mem_cgroup_hierarchical_reclaim(struct mem_cgroup *root_mem, | |||
1670 | victim = mem_cgroup_select_victim(root_mem); | 1670 | victim = mem_cgroup_select_victim(root_mem); |
1671 | if (victim == root_mem) { | 1671 | if (victim == root_mem) { |
1672 | loop++; | 1672 | loop++; |
1673 | if (loop >= 1) | 1673 | /* |
1674 | * We are not draining per cpu cached charges during | ||
1675 | * soft limit reclaim because global reclaim doesn't | ||
1676 | * care about charges. It tries to free some memory and | ||
1677 | * charges will not give any. | ||
1678 | */ | ||
1679 | if (!check_soft && loop >= 1) | ||
1674 | drain_all_stock_async(root_mem); | 1680 | drain_all_stock_async(root_mem); |
1675 | if (loop >= 2) { | 1681 | if (loop >= 2) { |
1676 | /* | 1682 | /* |