Skip to content

Commit 847b2f4

Browse files
committed
clockevents: Restructure clock_event_device members
Group the hot path members of struct clock_event_device 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> Reviewed-by: Ingo Molnar <mingo@elte.hu> Link: http://lkml.kernel.org/r/%3C20110518210136.223607682%40linutronix.de%3E
1 parent 724ed53 commit 847b2f4

File tree

1 file changed

+23
-22
lines changed

1 file changed

+23
-22
lines changed

include/linux/clockchips.h

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -56,46 +56,47 @@ enum clock_event_nofitiers {
5656

5757
/**
5858
* struct clock_event_device - clock event device descriptor
59-
* @name: ptr to clock event name
60-
* @features: features
59+
* @event_handler: Assigned by the framework to be called by the low
60+
* level handler of the event source
61+
* @set_next_event: set next event function
62+
* @next_event: local storage for the next event in oneshot mode
6163
* @max_delta_ns: maximum delta value in ns
6264
* @min_delta_ns: minimum delta value in ns
6365
* @mult: nanosecond to cycles multiplier
6466
* @shift: nanoseconds to cycles divisor (power of two)
67+
* @mode: operating mode assigned by the management code
68+
* @features: features
69+
* @retries: number of forced programming retries
70+
* @set_mode: set mode function
71+
* @broadcast: function to broadcast events
72+
* @name: ptr to clock event name
6573
* @rating: variable to rate clock event devices
6674
* @irq: IRQ number (only for non CPU local devices)
6775
* @cpumask: cpumask to indicate for which CPUs this device works
68-
* @set_next_event: set next event function
69-
* @set_mode: set mode function
70-
* @event_handler: Assigned by the framework to be called by the low
71-
* level handler of the event source
72-
* @broadcast: function to broadcast events
7376
* @list: list head for the management code
74-
* @mode: operating mode assigned by the management code
75-
* @next_event: local storage for the next event in oneshot mode
76-
* @retries: number of forced programming retries
7777
*/
7878
struct clock_event_device {
79-
const char *name;
80-
unsigned int features;
79+
void (*event_handler)(struct clock_event_device *);
80+
int (*set_next_event)(unsigned long evt,
81+
struct clock_event_device *);
82+
ktime_t next_event;
8183
u64 max_delta_ns;
8284
u64 min_delta_ns;
8385
u32 mult;
8486
u32 shift;
87+
enum clock_event_mode mode;
88+
unsigned int features;
89+
unsigned long retries;
90+
91+
void (*broadcast)(const struct cpumask *mask);
92+
void (*set_mode)(enum clock_event_mode mode,
93+
struct clock_event_device *);
94+
const char *name;
8595
int rating;
8696
int irq;
8797
const struct cpumask *cpumask;
88-
int (*set_next_event)(unsigned long evt,
89-
struct clock_event_device *);
90-
void (*set_mode)(enum clock_event_mode mode,
91-
struct clock_event_device *);
92-
void (*event_handler)(struct clock_event_device *);
93-
void (*broadcast)(const struct cpumask *mask);
9498
struct list_head list;
95-
enum clock_event_mode mode;
96-
ktime_t next_event;
97-
unsigned long retries;
98-
};
99+
} ____cacheline_aligned;
99100

100101
/*
101102
* Calculate a multiplication factor for scaled math, which is used to convert

0 commit comments

Comments
 (0)