Skip to content

Commit

Permalink
ksm: cond_resched in unstable tree
Browse files Browse the repository at this point in the history
KSM needs a cond_resched() for CONFIG_PREEMPT_NONE, in its unbounded
search of the unstable tree.  The stable tree cases already have one,
and originally there was one down inside get_user_pages();
but I missed it when I converted to follow_page() instead.

Signed-off-by: Hugh Dickins <hugh.dickins@tiscali.co.uk>
Acked-by: Izik Eidus <ieidus@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Hugh Dickins authored and Linus Torvalds committed Nov 9, 2009
1 parent b7b69c7 commit d178f27
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions mm/ksm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1012,6 +1012,7 @@ static struct rmap_item *unstable_tree_search_insert(struct page *page,
struct rmap_item *tree_rmap_item;
int ret;

cond_resched();
tree_rmap_item = rb_entry(*new, struct rmap_item, node);
page2[0] = get_mergeable_page(tree_rmap_item);
if (!page2[0])
Expand Down

0 comments on commit d178f27

Please sign in to comment.