Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=329c8d84ca1946c037d9859dc251b56d8b1b4630
Commit:     329c8d84ca1946c037d9859dc251b56d8b1b4630
Parent:     f75d222b836f7febfab0954c7612b23059d748cb
Author:     Eric Dumazet <[EMAIL PROTECTED]>
AuthorDate: Tue May 8 00:27:57 2007 -0700
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Tue May 8 11:15:06 2007 -0700

    time: SMP friendly alignment of struct clocksource
    
    struct clocksource is a critical data structure.
    
    Most of its fields are read only, some of them are heavily modified at each
    timer interrupt.
    
    It makes sense to separate those fields and make sure they all share one
    cache line, or at least the minimum for machines with small cache lines.
    
    [EMAIL PROTECTED]: build fix]
    Signed-off-by: Eric Dumazet <[EMAIL PROTECTED]>
    Acked-by: John Stultz <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 include/linux/clocksource.h |   15 +++++++++++++--
 1 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/include/linux/clocksource.h b/include/linux/clocksource.h
index daa4940..2665ca0 100644
--- a/include/linux/clocksource.h
+++ b/include/linux/clocksource.h
@@ -12,6 +12,7 @@
 #include <linux/timex.h>
 #include <linux/time.h>
 #include <linux/list.h>
+#include <linux/cache.h>
 #include <linux/timer.h>
 #include <asm/div64.h>
 #include <asm/io.h>
@@ -52,6 +53,9 @@ struct clocksource;
  * @xtime_interval:    Used internally by timekeeping core, please ignore.
  */
 struct clocksource {
+       /*
+        * First part of structure is read mostly
+        */
        char *name;
        struct list_head list;
        int rating;
@@ -63,8 +67,15 @@ struct clocksource {
        cycle_t (*vread)(void);
 
        /* timekeeping specific data, ignore */
-       cycle_t cycle_last, cycle_interval;
-       u64 xtime_nsec, xtime_interval;
+       cycle_t cycle_interval;
+       u64     xtime_interval;
+       /*
+        * Second part is written at each timer interrupt
+        * Keep it in a different cache line to dirty no
+        * more than one cache line.
+        */
+       cycle_t cycle_last ____cacheline_aligned_in_smp;
+       u64 xtime_nsec;
        s64 error;
 
 #ifdef CONFIG_CLOCKSOURCE_WATCHDOG
-
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