mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH -mm] tasklet_unlock_wait() cpu_relax()
@ 2006-06-14 19:29 Andreas Mohr
  2006-06-15 15:34 ` Arjan van de Ven
  2006-06-16 13:48 ` Christoph Hellwig
  0 siblings, 2 replies; 3+ messages in thread
From: Andreas Mohr @ 2006-06-14 19:29 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Nick Piggin, linux-kernel

Hi all,

use cpu_relax() here, too (instead of barrier()).

Signed-off-by: Andreas Mohr <andi@lisas.de>


diff -urN linux-2.6.17-rc6-mm2.orig/include/linux/interrupt.h linux-2.6.17-rc6-mm2.my/include/linux/interrupt.h
--- linux-2.6.17-rc6-mm2.orig/include/linux/interrupt.h	2006-06-13 19:28:16.000000000 +0200
+++ linux-2.6.17-rc6-mm2.my/include/linux/interrupt.h	2006-06-14 20:35:49.000000000 +0200
@@ -227,7 +227,7 @@
 
 static inline void tasklet_unlock_wait(struct tasklet_struct *t)
 {
-	while (test_bit(TASKLET_STATE_RUN, &(t)->state)) { barrier(); }
+	while (test_bit(TASKLET_STATE_RUN, &(t)->state)) { cpu_relax(); }
 }
 #else
 #define tasklet_trylock(t) 1

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

* Re: [PATCH -mm] tasklet_unlock_wait() cpu_relax()
  2006-06-14 19:29 [PATCH -mm] tasklet_unlock_wait() cpu_relax() Andreas Mohr
@ 2006-06-15 15:34 ` Arjan van de Ven
  2006-06-16 13:48 ` Christoph Hellwig
  1 sibling, 0 replies; 3+ messages in thread
From: Arjan van de Ven @ 2006-06-15 15:34 UTC (permalink / raw)
  To: Andreas Mohr; +Cc: Andrew Morton, Nick Piggin, linux-kernel

On Wed, 2006-06-14 at 21:29 +0200, Andreas Mohr wrote:
> Hi all,
> 
> use cpu_relax() here, too (instead of barrier()).
> 
> Signed-off-by: Andreas Mohr <andi@lisas.de>

Very useful

Acked-by: Arjan van de Ven <arjan@linux.intel.com>


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

* Re: [PATCH -mm] tasklet_unlock_wait() cpu_relax()
  2006-06-14 19:29 [PATCH -mm] tasklet_unlock_wait() cpu_relax() Andreas Mohr
  2006-06-15 15:34 ` Arjan van de Ven
@ 2006-06-16 13:48 ` Christoph Hellwig
  1 sibling, 0 replies; 3+ messages in thread
From: Christoph Hellwig @ 2006-06-16 13:48 UTC (permalink / raw)
  To: Andreas Mohr; +Cc: Andrew Morton, Nick Piggin, linux-kernel

On Wed, Jun 14, 2006 at 09:29:20PM +0200, Andreas Mohr wrote:
> Hi all,
> 
> use cpu_relax() here, too (instead of barrier()).
> 
> Signed-off-by: Andreas Mohr <andi@lisas.de>
> 
> 
> diff -urN linux-2.6.17-rc6-mm2.orig/include/linux/interrupt.h linux-2.6.17-rc6-mm2.my/include/linux/interrupt.h
> --- linux-2.6.17-rc6-mm2.orig/include/linux/interrupt.h	2006-06-13 19:28:16.000000000 +0200
> +++ linux-2.6.17-rc6-mm2.my/include/linux/interrupt.h	2006-06-14 20:35:49.000000000 +0200
> @@ -227,7 +227,7 @@
>  
>  static inline void tasklet_unlock_wait(struct tasklet_struct *t)
>  {
> -	while (test_bit(TASKLET_STATE_RUN, &(t)->state)) { barrier(); }
> +	while (test_bit(TASKLET_STATE_RUN, &(t)->state)) { cpu_relax(); }
>  }

While you're at it could you reformat it to proper kernel style, e.g.:

static inline void tasklet_unlock_wait(struct tasklet_struct *t)
{
	while (test_bit(TASKLET_STATE_RUN, &t->state))
		cpu_relax();
}

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

end of thread, other threads:[~2006-06-16 13:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-06-14 19:29 [PATCH -mm] tasklet_unlock_wait() cpu_relax() Andreas Mohr
2006-06-15 15:34 ` Arjan van de Ven
2006-06-16 13:48 ` Christoph Hellwig

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

all inboxes | Powered by JetHome®