diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2011-05-18 17:33:40 -0400 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2011-05-19 08:24:15 -0400 |
commit | 369db4c9524b7487faf1ff89646eee396c1363e1 (patch) | |
tree | 0df5fb62ebc4b233ef962a12cd7791509a31c9e3 /include/linux/clocksource.h | |
parent | a18f22a968de17b29f2310cdb7ba69163e65ec15 (diff) |
clocksource: Restructure clocksource struct members
Group the hot path members of struct clocksource together so we have a
better cache line footprint. Make it cacheline aligned.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: John Stultz <john.stultz@linaro.org>
Cc: Eric Dumazet <eric.dumazet@gmail.com>
Reviewed-by: Ingo Molnar <mingo@elte.hu>
Link: http://lkml.kernel.org/r/%3C20110518210136.003081882%40linutronix.de%3E
Diffstat (limited to 'include/linux/clocksource.h')
-rw-r--r-- | include/linux/clocksource.h | 32 |
1 files changed, 14 insertions, 18 deletions
diff --git a/include/linux/clocksource.h b/include/linux/clocksource.h index 0fb0b7e79394..c918fbd33ee5 100644 --- a/include/linux/clocksource.h +++ b/include/linux/clocksource.h | |||
@@ -159,42 +159,38 @@ extern u64 timecounter_cyc2time(struct timecounter *tc, | |||
159 | */ | 159 | */ |
160 | struct clocksource { | 160 | struct clocksource { |
161 | /* | 161 | /* |
162 | * First part of structure is read mostly | 162 | * Hotpath data, fits in a single cache line when the |
163 | * clocksource itself is cacheline aligned. | ||
163 | */ | 164 | */ |
164 | const char *name; | ||
165 | struct list_head list; | ||
166 | int rating; | ||
167 | cycle_t (*read)(struct clocksource *cs); | 165 | cycle_t (*read)(struct clocksource *cs); |
168 | int (*enable)(struct clocksource *cs); | 166 | cycle_t cycle_last; |
169 | void (*disable)(struct clocksource *cs); | ||
170 | cycle_t mask; | 167 | cycle_t mask; |
171 | u32 mult; | 168 | u32 mult; |
172 | u32 shift; | 169 | u32 shift; |
173 | u64 max_idle_ns; | 170 | u64 max_idle_ns; |
174 | unsigned long flags; | 171 | |
175 | cycle_t (*vread)(void); | ||
176 | void (*suspend)(struct clocksource *cs); | ||
177 | void (*resume)(struct clocksource *cs); | ||
178 | #ifdef CONFIG_IA64 | 172 | #ifdef CONFIG_IA64 |
179 | void *fsys_mmio; /* used by fsyscall asm code */ | 173 | void *fsys_mmio; /* used by fsyscall asm code */ |
180 | #define CLKSRC_FSYS_MMIO_SET(mmio, addr) ((mmio) = (addr)) | 174 | #define CLKSRC_FSYS_MMIO_SET(mmio, addr) ((mmio) = (addr)) |
181 | #else | 175 | #else |
182 | #define CLKSRC_FSYS_MMIO_SET(mmio, addr) do { } while (0) | 176 | #define CLKSRC_FSYS_MMIO_SET(mmio, addr) do { } while (0) |
183 | #endif | 177 | #endif |
184 | 178 | const char *name; | |
185 | /* | 179 | struct list_head list; |
186 | * Second part is written at each timer interrupt | 180 | int rating; |
187 | * Keep it in a different cache line to dirty no | 181 | cycle_t (*vread)(void); |
188 | * more than one cache line. | 182 | int (*enable)(struct clocksource *cs); |
189 | */ | 183 | void (*disable)(struct clocksource *cs); |
190 | cycle_t cycle_last ____cacheline_aligned_in_smp; | 184 | unsigned long flags; |
185 | void (*suspend)(struct clocksource *cs); | ||
186 | void (*resume)(struct clocksource *cs); | ||
191 | 187 | ||
192 | #ifdef CONFIG_CLOCKSOURCE_WATCHDOG | 188 | #ifdef CONFIG_CLOCKSOURCE_WATCHDOG |
193 | /* Watchdog related data, used by the framework */ | 189 | /* Watchdog related data, used by the framework */ |
194 | struct list_head wd_list; | 190 | struct list_head wd_list; |
195 | cycle_t wd_last; | 191 | cycle_t wd_last; |
196 | #endif | 192 | #endif |
197 | }; | 193 | } ____cacheline_aligned; |
198 | 194 | ||
199 | /* | 195 | /* |
200 | * Clock source flags bits:: | 196 | * Clock source flags bits:: |