summaryrefslogtreecommitdiffstats
path: root/mm/ksm.c
diff options
context:
space:
mode:
authorAndrea Arcangeli <aarcange@redhat.com>2015-11-05 18:49:07 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2015-11-05 19:34:48 -0800
commitad12695f177c3403a64348b42718faf9727fe358 (patch)
tree1638831bffe23bcf83170c534102e912c2d7637a /mm/ksm.c
parentdf4065516b0dbfa35ac0e9b8124d441221c0a285 (diff)
downloadlinux-stable-ad12695f177c3403a64348b42718faf9727fe358.tar.gz
linux-stable-ad12695f177c3403a64348b42718faf9727fe358.tar.bz2
linux-stable-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/ksm.c')
-rw-r--r--mm/ksm.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/mm/ksm.c b/mm/ksm.c
index 7ee101eaacdf..e87dec7ba950 100644
--- a/mm/ksm.c
+++ b/mm/ksm.c
@@ -1914,9 +1914,11 @@ again:
struct anon_vma_chain *vmac;
struct vm_area_struct *vma;
+ cond_resched();
anon_vma_lock_read(anon_vma);
anon_vma_interval_tree_foreach(vmac, &anon_vma->rb_root,
0, ULONG_MAX) {
+ cond_resched();
vma = vmac->vma;
if (rmap_item->address < vma->vm_start ||
rmap_item->address >= vma->vm_end)