summaryrefslogtreecommitdiffstats
path: root/mm/rmap.c
diff options
context:
space:
mode:
authorAndrea Arcangeli <aarcange@redhat.com>2015-11-06 03:49:07 +0100
committerLinus Torvalds <torvalds@linux-foundation.org>2015-11-06 04:34:48 +0100
commitad12695f177c3403a64348b42718faf9727fe358 (patch)
tree1638831bffe23bcf83170c534102e912c2d7637a /mm/rmap.c
parentmemcg: simplify and inline __mem_cgroup_from_kmem (diff)
downloadlinux-ad12695f177c3403a64348b42718faf9727fe358.tar.xz
linux-ad12695f177c3403a64348b42718faf9727fe358.zip
ksm: add cond_resched() to the rmap_walks
While at it add it to the file and anon walks too. Signed-off-by: Andrea Arcangeli <aarcange@redhat.com> Acked-by: Hugh Dickins <hughd@google.com> Cc: Petr Holasek <pholasek@redhat.com> Acked-by: Davidlohr Bueso <dbueso@suse.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/rmap.c')
-rw-r--r--mm/rmap.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/mm/rmap.c b/mm/rmap.c
index d40e7aefb888..78a692827a63 100644
--- a/mm/rmap.c
+++ b/mm/rmap.c
@@ -1609,6 +1609,8 @@ static int rmap_walk_anon(struct page *page, struct rmap_walk_control *rwc)
struct vm_area_struct *vma = avc->vma;
unsigned long address = vma_address(page, vma);
+ cond_resched();
+
if (rwc->invalid_vma && rwc->invalid_vma(vma, rwc->arg))
continue;
@@ -1658,6 +1660,8 @@ static int rmap_walk_file(struct page *page, struct rmap_walk_control *rwc)
vma_interval_tree_foreach(vma, &mapping->i_mmap, pgoff, pgoff) {
unsigned long address = vma_address(page, vma);
+ cond_resched();
+
if (rwc->invalid_vma && rwc->invalid_vma(vma, rwc->arg))
continue;