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>
This commit is contained in:

committed by
Linus Torvalds

parent
e1bbd19bc4
commit
a433658c30
@@ -2081,7 +2081,7 @@ static unsigned long do_try_to_free_pages(struct zonelist *zonelist,
|
||||
for (priority = DEF_PRIORITY; priority >= 0; priority--) {
|
||||
sc->nr_scanned = 0;
|
||||
if (!priority)
|
||||
disable_swap_token();
|
||||
disable_swap_token(sc->mem_cgroup);
|
||||
total_scanned += shrink_zones(priority, zonelist, sc);
|
||||
/*
|
||||
* Don't shrink slabs when reclaiming memory from
|
||||
@@ -2407,7 +2407,7 @@ loop_again:
|
||||
|
||||
/* The swap token gets in the way of swapout... */
|
||||
if (!priority)
|
||||
disable_swap_token();
|
||||
disable_swap_token(NULL);
|
||||
|
||||
all_zones_ok = 1;
|
||||
balanced = 0;
|
||||
|
Reference in New Issue
Block a user