mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-01 18:53:30 +00:00
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/alpine.DEB.2.10.1704061315270.80559@chino.kir.corp.google.com Signed-off-by: David Rientjes <rientjes@google.com> Acked-by: Michal Hocko <mhocko@suse.com> Cc: Johannes Weiner <hannes@cmpxchg.org> Cc: Vladimir Davydov <vdavydov.dev@gmail.com> Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
e11f8b7b6c
commit
460bcec84e
@ -201,6 +201,8 @@ void swap_cgroup_swapoff(int type)
|
|||||||
struct page *page = map[i];
|
struct page *page = map[i];
|
||||||
if (page)
|
if (page)
|
||||||
__free_page(page);
|
__free_page(page);
|
||||||
|
if (!(i % SWAP_CLUSTER_MAX))
|
||||||
|
cond_resched();
|
||||||
}
|
}
|
||||||
vfree(map);
|
vfree(map);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user