cluster-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
* [Cluster-devel] dlm: Use cond_resched() in ast delivery loop
@ 2008-12-10 11:42 Steven Whitehouse
  2008-12-10 15:28 ` [Cluster-devel] " David Teigland
  0 siblings, 1 reply; 2+ messages in thread
From: Steven Whitehouse @ 2008-12-10 11:42 UTC (permalink / raw)
  To: cluster-devel.redhat.com


This is a one-liner to use cond_resched() rather than schedule()
in the ast delivery loop. It should not be necessary to schedule
every time, so this will save some cpu time while continuing to
allow scheduling when required.

Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>

diff --git a/fs/dlm/ast.c b/fs/dlm/ast.c
index 8bf31e3..30c11f3 100644
--- a/fs/dlm/ast.c
+++ b/fs/dlm/ast.c
@@ -101,7 +101,7 @@ static void process_asts(void)
 		   and may result in the lkb being freed */
 		dlm_put_lkb(lkb);
 
-		schedule();
+		cond_resched();
 	}
 }
 




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

* [Cluster-devel] Re: dlm: Use cond_resched() in ast delivery loop
  2008-12-10 11:42 [Cluster-devel] dlm: Use cond_resched() in ast delivery loop Steven Whitehouse
@ 2008-12-10 15:28 ` David Teigland
  0 siblings, 0 replies; 2+ messages in thread
From: David Teigland @ 2008-12-10 15:28 UTC (permalink / raw)
  To: cluster-devel.redhat.com

On Wed, Dec 10, 2008 at 11:42:06AM +0000, Steven Whitehouse wrote:
> 
> This is a one-liner to use cond_resched() rather than schedule()
> in the ast delivery loop. It should not be necessary to schedule
> every time, so this will save some cpu time while continuing to
> allow scheduling when required.

Thanks, will queue it up.

> 
> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
> 
> diff --git a/fs/dlm/ast.c b/fs/dlm/ast.c
> index 8bf31e3..30c11f3 100644
> --- a/fs/dlm/ast.c
> +++ b/fs/dlm/ast.c
> @@ -101,7 +101,7 @@ static void process_asts(void)
>  		   and may result in the lkb being freed */
>  		dlm_put_lkb(lkb);
>  
> -		schedule();
> +		cond_resched();
>  	}
>  }
>  
> 



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

end of thread, other threads:[~2008-12-10 15:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-10 11:42 [Cluster-devel] dlm: Use cond_resched() in ast delivery loop Steven Whitehouse
2008-12-10 15:28 ` [Cluster-devel] " David Teigland

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).