projects/linux·commit 7ae534d0

memcg: fix wrong check of noswap with softlimit

7ae534d0 · KAMEZAWA Hiroyuki <[email protected]> · 2011-06-15 15:08:44 -07:00

Hierarchical reclaim doesn't swap out if memsw and resource limits are
thye same (memsw_is_minimum == true) because we would hit mem+swap limit
anyway (during hard limit reclaim).

If it comes to the soft limit we shouldn't consider memsw_is_minimum at
all because it doesn't make much sense.  Either the soft limit is bellow
the hard limit and then we cannot hit mem+swap limit or the direct reclaim
takes a precedence.

Signed-off-by: KAMEZAWA Hiroyuki <[email protected]>
Reviewed-by: Michal Hocko <[email protected]>
Acked-by: Daisuke Nishimura <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Commit
7ae534d074e01e54d5cfbc9734b73fdfc855501f
Parents
733eda7a

Changes

1 files changed · +1 −1

FileStatusAddDelContent
mm/memcontrol.cmodified+1−1View file

mm/memcontrol.c

View file
diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index 02a7947..0b1a32c 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -1663,7 +1663,7 @@ static int mem_cgroup_hierarchical_reclaim(struct mem_cgroup *root_mem,
excess = res_counter_soft_limit_excess(&root_mem->res) >> PAGE_SHIFT;
/* If memsw_is_minimum==1, swap-out is of-no-use. */
- if (root_mem->memsw_is_minimum)
+ if (!check_soft && root_mem->memsw_is_minimum)
noswap = true;
while (1) {