aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2006-03-26 04:38:05 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-03-26 11:57:02 -0500
commit92127c7a45d4d167d9b015a5f9de6b41ed66f1d0 (patch)
tree4742cc36ff0b26c999365d1e84133886bb694096 /include/linux
parenta0e9285233a32edf267d27cd03fe0056951422cf (diff)
[PATCH] hrtimers: optimize softirq runqueues
The hrtimer softirq is called from the timer softirq every tick. Retrieve the current time from xtime and wall_to_monotonic instead of calling base->get_time() for each timer base. Store the time in the base structure and provide a hook once clock source abstractions are in place and to keep the code open for new base clocks. Based on a patch from: Roman Zippel <zippel@linux-m68k.org> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/hrtimer.h20
1 files changed, 12 insertions, 8 deletions
diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h
index 6401c31d6add..64e2754ca734 100644
--- a/include/linux/hrtimer.h
+++ b/include/linux/hrtimer.h
@@ -72,14 +72,16 @@ struct hrtimer {
72/** 72/**
73 * struct hrtimer_base - the timer base for a specific clock 73 * struct hrtimer_base - the timer base for a specific clock
74 * 74 *
75 * @index: clock type index for per_cpu support when moving a timer 75 * @index: clock type index for per_cpu support when moving a timer
76 * to a base on another cpu. 76 * to a base on another cpu.
77 * @lock: lock protecting the base and associated timers 77 * @lock: lock protecting the base and associated timers
78 * @active: red black tree root node for the active timers 78 * @active: red black tree root node for the active timers
79 * @first: pointer to the timer node which expires first 79 * @first: pointer to the timer node which expires first
80 * @resolution: the resolution of the clock, in nanoseconds 80 * @resolution: the resolution of the clock, in nanoseconds
81 * @get_time: function to retrieve the current time of the clock 81 * @get_time: function to retrieve the current time of the clock
82 * @curr_timer: the timer which is executing a callback right now 82 * @get_sofirq_time: function to retrieve the current time from the softirq
83 * @curr_timer: the timer which is executing a callback right now
84 * @softirq_time: the time when running the hrtimer queue in the softirq
83 */ 85 */
84struct hrtimer_base { 86struct hrtimer_base {
85 clockid_t index; 87 clockid_t index;
@@ -88,7 +90,9 @@ struct hrtimer_base {
88 struct rb_node *first; 90 struct rb_node *first;
89 ktime_t resolution; 91 ktime_t resolution;
90 ktime_t (*get_time)(void); 92 ktime_t (*get_time)(void);
93 ktime_t (*get_softirq_time)(void);
91 struct hrtimer *curr_timer; 94 struct hrtimer *curr_timer;
95 ktime_t softirq_time;
92}; 96};
93 97
94/* 98/*