[PATCH -mm 1/6] cpu_relax(): interrupt.h

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Add cpu_relax() to tasklet_unlock_wait() loop.


I kept barrier() since it is said to still be required, in various older
postings.
Took care of kernel style formatting.

Tested on 2.6.17-mm1.


This is the first patch within a set, which aims to improve P4 HT performance
a bit:
these SMT CPUs want a rep nop (pause) (as done by cpu_relax()) when
busy-polling, in order to free pipeline resources for the SMT CPU sibling.

During I/O polling cpu_relax() will help for non-P4 CPUs, too (reduce
power consumption there).

Signed-off-by: Andreas Mohr <[email protected]>


diff -urN linux-2.6.17-mm1.orig/include/linux/interrupt.h linux-2.6.17-mm1.my/include/linux/interrupt.h
--- linux-2.6.17-mm1.orig/include/linux/interrupt.h	2006-06-21 14:28:19.000000000 +0200
+++ linux-2.6.17-mm1.my/include/linux/interrupt.h	2006-06-21 21:34:12.000000000 +0200
@@ -227,7 +227,10 @@
 
 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)) {
+		barrier();
+		cpu_relax();
+	}
 }
 #else
 #define tasklet_trylock(t) 1
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux