aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Rientjes <[email protected]>2017-04-07 16:05:00 -0700
committerLinus Torvalds <[email protected]>2017-04-08 00:47:49 -0700
commit460bcec84e11c75122ace5976214abbc596eb91b (patch)
treed73d64a305d28d8bf9a0389b021aa543f18e223b
parente11f8b7b6c4ea13bf8af6b8f42b45e15b554a92b (diff)
mm, swap_cgroup: reschedule when neeed in swap_cgroup_swapoff()
We got need_resched() warnings in swap_cgroup_swapoff() because swap_cgroup_ctrl[type].length is particularly large. Reschedule when needed. Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: David Rientjes <[email protected]> Acked-by: Michal Hocko <[email protected]> Cc: Johannes Weiner <[email protected]> Cc: Vladimir Davydov <[email protected]> Cc: KAMEZAWA Hiroyuki <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
-rw-r--r--mm/swap_cgroup.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/mm/swap_cgroup.c b/mm/swap_cgroup.c
index 310ac0b8f974..ac6318a064d3 100644
--- a/mm/swap_cgroup.c
+++ b/mm/swap_cgroup.c
@@ -201,6 +201,8 @@ void swap_cgroup_swapoff(int type)
struct page *page = map[i];
if (page)
__free_page(page);
+ if (!(i % SWAP_CLUSTER_MAX))
+ cond_resched();
}
vfree(map);
}