diff options
author | KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> | 2011-06-15 18:08:13 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-06-15 23:03:59 -0400 |
commit | a433658c30974fc87ba3ff52d7e4e6299762aa3d (patch) | |
tree | 8df65e22af520ca5c020281763e6874d0bb51bc5 /mm/vmscan.c | |
parent | e1bbd19bc4afef7adb80cca163800391c4f5773d (diff) |
vmscan,memcg: memcg aware swap token
Currently, memcg reclaim can disable swap token even if the swap token mm
doesn't belong in its memory cgroup. It's slightly risky. If an admin
creates very small mem-cgroup and silly guy runs contentious heavy memory
pressure workload, every tasks are going to lose swap token and then
system may become unresponsive. That's bad.
This patch adds 'memcg' parameter into disable_swap_token(). and if the
parameter doesn't match swap token, VM doesn't disable it.
[akpm@linux-foundation.org: coding-style fixes]
Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Reviewed-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Reviewed-by: Rik van Riel<riel@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/vmscan.c')
-rw-r--r-- | mm/vmscan.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/mm/vmscan.c b/mm/vmscan.c index faa0a088f9cc..dbe6ea321df4 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c | |||
@@ -2081,7 +2081,7 @@ static unsigned long do_try_to_free_pages(struct zonelist *zonelist, | |||
2081 | for (priority = DEF_PRIORITY; priority >= 0; priority--) { | 2081 | for (priority = DEF_PRIORITY; priority >= 0; priority--) { |
2082 | sc->nr_scanned = 0; | 2082 | sc->nr_scanned = 0; |
2083 | if (!priority) | 2083 | if (!priority) |
2084 | disable_swap_token(); | 2084 | disable_swap_token(sc->mem_cgroup); |
2085 | total_scanned += shrink_zones(priority, zonelist, sc); | 2085 | total_scanned += shrink_zones(priority, zonelist, sc); |
2086 | /* | 2086 | /* |
2087 | * Don't shrink slabs when reclaiming memory from | 2087 | * Don't shrink slabs when reclaiming memory from |
@@ -2407,7 +2407,7 @@ loop_again: | |||
2407 | 2407 | ||
2408 | /* The swap token gets in the way of swapout... */ | 2408 | /* The swap token gets in the way of swapout... */ |
2409 | if (!priority) | 2409 | if (!priority) |
2410 | disable_swap_token(); | 2410 | disable_swap_token(NULL); |
2411 | 2411 | ||
2412 | all_zones_ok = 1; | 2412 | all_zones_ok = 1; |
2413 | balanced = 0; | 2413 | balanced = 0; |