Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=267eb01a62b1190d0bf87b1ef3b0c9d21cdb2c57
Commit:     267eb01a62b1190d0bf87b1ef3b0c9d21cdb2c57
Parent:     8f03d6ce4ee20e7521b69188f6b5a9bb9ba7457f
Author:     Andreas Mohr <[EMAIL PROTECTED]>
AuthorDate: Sat Jul 21 17:11:25 2007 +0200
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Sat Jul 21 18:37:13 2007 -0700

    i386: add cpu_relax() to cmos_lock()
    
    Add cpu_relax() to cmos_lock() inline function for faster operation on SMT
    CPUs and less power consumption on others in case of lock contention (which
    probably doesn't happen too often, so admittedly this patch is not too
    exciting).
    
    [EMAIL PROTECTED]: Include the header file for cpu_relax()]
    Signed-off-by: Andreas Mohr <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Andi Kleen <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 include/asm-i386/mc146818rtc.h |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/include/asm-i386/mc146818rtc.h b/include/asm-i386/mc146818rtc.h
index 99a8900..1613b42 100644
--- a/include/asm-i386/mc146818rtc.h
+++ b/include/asm-i386/mc146818rtc.h
@@ -6,6 +6,7 @@
 
 #include <asm/io.h>
 #include <asm/system.h>
+#include <asm/processor.h>
 #include <linux/mc146818rtc.h>
 
 #ifndef RTC_PORT
@@ -43,8 +44,10 @@ static inline void lock_cmos(unsigned char reg)
        unsigned long new;
        new = ((smp_processor_id()+1) << 8) | reg;
        for (;;) {
-               if (cmos_lock)
+               if (cmos_lock) {
+                       cpu_relax();
                        continue;
+               }
                if (__cmpxchg(&cmos_lock, 0, new, sizeof(cmos_lock)) == 0)
                        return;
        }
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to