public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ksm: cond_resched in unstable tree
@ 2009-11-09 15:58 Hugh Dickins
  2009-11-09 16:28 ` Izik Eidus
  0 siblings, 1 reply; 2+ messages in thread
From: Hugh Dickins @ 2009-11-09 15:58 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Andrew Morton, Izik Eidus, Andrea Arcangeli, linux-kernel

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>
---

 mm/ksm.c |    1 +
 1 file changed, 1 insertion(+)

--- 2.6.32-rc6/mm/ksm.c	2009-10-12 00:26:43.000000000 +0100
+++ linux/mm/ksm.c	2009-11-07 14:44:58.000000000 +0000
@@ -1012,6 +1012,7 @@ static struct rmap_item *unstable_tree_s
 		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])

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] ksm: cond_resched in unstable tree
  2009-11-09 15:58 [PATCH] ksm: cond_resched in unstable tree Hugh Dickins
@ 2009-11-09 16:28 ` Izik Eidus
  0 siblings, 0 replies; 2+ messages in thread
From: Izik Eidus @ 2009-11-09 16:28 UTC (permalink / raw)
  To: Hugh Dickins
  Cc: Linus Torvalds, Andrew Morton, Andrea Arcangeli, linux-kernel

On 11/09/2009 05:58 PM, Hugh Dickins wrote:
> 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>
> ---
>
>   mm/ksm.c |    1 +
>   1 file changed, 1 insertion(+)
>
> --- 2.6.32-rc6/mm/ksm.c	2009-10-12 00:26:43.000000000 +0100
> +++ linux/mm/ksm.c	2009-11-07 14:44:58.000000000 +0000
> @@ -1012,6 +1012,7 @@ static struct rmap_item *unstable_tree_s
>   		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])
>    
ACK.
Low risk patch - we are for sure at sleepable context there.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-11-09 16:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-09 15:58 [PATCH] ksm: cond_resched in unstable tree Hugh Dickins
2009-11-09 16:28 ` Izik Eidus

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox