tasklet_unlock_wait() cpu_relax()
PATCH 1/1 tasklet_unlock_wait() cpu_relax()
Hi all,
use cpu_relax() here, too (instead of barrier()).
Signed-off-by Andreas Mohr <[email protected]>
include/linux/interrupt.h +1 -1
@@ -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
Quoted 5 lines · Andreas Mohr
Hi all,
use
cpu_relax()here, too (instead ofbarrier()).Signed-off-by Andreas Mohr <[email protected]>
Very useful
Acked-by Arjan van de Ven <[email protected]>
Quoted 11 lines · Andreas Mohr
Hi all,
use
cpu_relax()here, too (instead ofbarrier()).Signed-off-by Andreas Mohr <[email protected]>diff -urN
linux-2.6.17-rc6-mm2.orig/include/linux/interrupt.hlinux-2.6.17-rc6-mm2.my/include/linux/interrupt.h
include/linux/interrupt.h line 231
Quoted 6 lines
include/linux/interrupt.h +1
-1@@ -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();
}