I was thinking about a general optimization --- something like this. On
Core2 it doesn't make much sense --- cli is fast there (just 11 ticks). On
Pentium 4 it would make sense, because cli is much more costy there.
Mikulas
---
include/asm-x86/irqflags.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
Index: linux-2.6.26-rc8/include/asm-x86/irqflags.h
===================================================================
--- linux-2.6.26-rc8.orig/include/asm-x86/irqflags.h 2008-06-02 23:13:32.000000000 +0200
+++ linux-2.6.26-rc8/include/asm-x86/irqflags.h 2008-07-03 22:53:32.000000000 +0200
@@ -101,7 +101,8 @@ static inline unsigned long __raw_local_
{
unsigned long flags = __raw_local_save_flags();
- raw_local_irq_disable();
+ if (flags & X86_EFLAGS_IF)
+ raw_local_irq_disable();
return flags;
}
--