diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-01-06 13:42:43 -0500 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-01-06 13:42:43 -0500 |
| commit | dda5f0a372873bca5f0b1d1866d7784dffd8b675 (patch) | |
| tree | 1f745951b51ef9dcd127ca3c65ecb1d2ce4967c2 /include/linux | |
| parent | 65b2074f84be2287e020839e93b4cdaaf60eb37c (diff) | |
| parent | 88606e80da0e8d862a42ee19e5bb60b01b940ea7 (diff) | |
Merge branch 'timers-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'timers-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
MAINTAINERS: Update timer related entries
timers: Use this_cpu_read
timerqueue: Make timerqueue_getnext() static inline
hrtimer: fix timerqueue conversion flub
hrtimers: Convert hrtimers to use timerlist infrastructure
timers: Fixup allmodconfig build issue
timers: Rename timerlist infrastructure to timerqueue
timers: Introduce timerlist infrastructure.
hrtimer: Remove stale comment on curr_timer
timer: Warn when del_timer_sync() is called in hardirq context
timer: Del_timer_sync() can be used in softirq context
timer: Make try_to_del_timer_sync() the same on SMP and UP
posix-timers: Annotate lock_timer()
timer: Permit statically-declared work with deferrable timers
time: Use ARRAY_SIZE macro in timecompare.c
timer: Initialize the field slack of timer_list
timer_list: Remove alignment padding on 64 bit when CONFIG_TIMER_STATS
time: Compensate for rounding on odd-frequency clocksources
Fix up trivial conflict in MAINTAINERS
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/hrtimer.h | 33 | ||||
| -rw-r--r-- | include/linux/timer.h | 32 | ||||
| -rw-r--r-- | include/linux/timerqueue.h | 50 | ||||
| -rw-r--r-- | include/linux/workqueue.h | 8 |
4 files changed, 102 insertions, 21 deletions
diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h index fd0c1b857d3d..330586ffffbb 100644 --- a/include/linux/hrtimer.h +++ b/include/linux/hrtimer.h | |||
| @@ -22,7 +22,7 @@ | |||
| 22 | #include <linux/wait.h> | 22 | #include <linux/wait.h> |
| 23 | #include <linux/percpu.h> | 23 | #include <linux/percpu.h> |
| 24 | #include <linux/timer.h> | 24 | #include <linux/timer.h> |
| 25 | 25 | #include <linux/timerqueue.h> | |
| 26 | 26 | ||
| 27 | struct hrtimer_clock_base; | 27 | struct hrtimer_clock_base; |
| 28 | struct hrtimer_cpu_base; | 28 | struct hrtimer_cpu_base; |
| @@ -79,8 +79,8 @@ enum hrtimer_restart { | |||
| 79 | 79 | ||
| 80 | /** | 80 | /** |
| 81 | * struct hrtimer - the basic hrtimer structure | 81 | * struct hrtimer - the basic hrtimer structure |
| 82 | * @node: red black tree node for time ordered insertion | 82 | * @node: timerqueue node, which also manages node.expires, |
| 83 | * @_expires: the absolute expiry time in the hrtimers internal | 83 | * the absolute expiry time in the hrtimers internal |
| 84 | * representation. The time is related to the clock on | 84 | * representation. The time is related to the clock on |
| 85 | * which the timer is based. Is setup by adding | 85 | * which the timer is based. Is setup by adding |
| 86 | * slack to the _softexpires value. For non range timers | 86 | * slack to the _softexpires value. For non range timers |
| @@ -101,8 +101,7 @@ enum hrtimer_restart { | |||
| 101 | * The hrtimer structure must be initialized by hrtimer_init() | 101 | * The hrtimer structure must be initialized by hrtimer_init() |
| 102 | */ | 102 | */ |
| 103 | struct hrtimer { | 103 | struct hrtimer { |
| 104 | struct rb_node node; | 104 | struct timerqueue_node node; |
| 105 | ktime_t _expires; | ||
| 106 | ktime_t _softexpires; | 105 | ktime_t _softexpires; |
| 107 | enum hrtimer_restart (*function)(struct hrtimer *); | 106 | enum hrtimer_restart (*function)(struct hrtimer *); |
| 108 | struct hrtimer_clock_base *base; | 107 | struct hrtimer_clock_base *base; |
| @@ -141,8 +140,7 @@ struct hrtimer_sleeper { | |||
| 141 | struct hrtimer_clock_base { | 140 | struct hrtimer_clock_base { |
| 142 | struct hrtimer_cpu_base *cpu_base; | 141 | struct hrtimer_cpu_base *cpu_base; |
| 143 | clockid_t index; | 142 | clockid_t index; |
| 144 | struct rb_root active; | 143 | struct timerqueue_head active; |
| 145 | struct rb_node *first; | ||
| 146 | ktime_t resolution; | 144 | ktime_t resolution; |
| 147 | ktime_t (*get_time)(void); | 145 | ktime_t (*get_time)(void); |
| 148 | ktime_t softirq_time; | 146 | ktime_t softirq_time; |
| @@ -158,7 +156,6 @@ struct hrtimer_clock_base { | |||
| 158 | * @lock: lock protecting the base and associated clock bases | 156 | * @lock: lock protecting the base and associated clock bases |
| 159 | * and timers | 157 | * and timers |
| 160 | * @clock_base: array of clock bases for this cpu | 158 | * @clock_base: array of clock bases for this cpu |
| 161 | * @curr_timer: the timer which is executing a callback right now | ||
| 162 | * @expires_next: absolute time of the next event which was scheduled | 159 | * @expires_next: absolute time of the next event which was scheduled |
| 163 | * via clock_set_next_event() | 160 | * via clock_set_next_event() |
| 164 | * @hres_active: State of high resolution mode | 161 | * @hres_active: State of high resolution mode |
| @@ -184,43 +181,43 @@ struct hrtimer_cpu_base { | |||
| 184 | 181 | ||
| 185 | static inline void hrtimer_set_expires(struct hrtimer *timer, ktime_t time) | 182 | static inline void hrtimer_set_expires(struct hrtimer *timer, ktime_t time) |
| 186 | { | 183 | { |
| 187 | timer->_expires = time; | 184 | timer->node.expires = time; |
| 188 | timer->_softexpires = time; | 185 | timer->_softexpires = time; |
| 189 | } | 186 | } |
| 190 | 187 | ||
| 191 | static inline void hrtimer_set_expires_range(struct hrtimer *timer, ktime_t time, ktime_t delta) | 188 | static inline void hrtimer_set_expires_range(struct hrtimer *timer, ktime_t time, ktime_t delta) |
| 192 | { | 189 | { |
| 193 | timer->_softexpires = time; | 190 | timer->_softexpires = time; |
| 194 | timer->_expires = ktime_add_safe(time, delta); | 191 | timer->node.expires = ktime_add_safe(time, delta); |
| 195 | } | 192 | } |
| 196 | 193 | ||
| 197 | static inline void hrtimer_set_expires_range_ns(struct hrtimer *timer, ktime_t time, unsigned long delta) | 194 | static inline void hrtimer_set_expires_range_ns(struct hrtimer *timer, ktime_t time, unsigned long delta) |
| 198 | { | 195 | { |
| 199 | timer->_softexpires = time; | 196 | timer->_softexpires = time; |
| 200 | timer->_expires = ktime_add_safe(time, ns_to_ktime(delta)); | 197 | timer->node.expires = ktime_add_safe(time, ns_to_ktime(delta)); |
| 201 | } | 198 | } |
| 202 | 199 | ||
| 203 | static inline void hrtimer_set_expires_tv64(struct hrtimer *timer, s64 tv64) | 200 | static inline void hrtimer_set_expires_tv64(struct hrtimer *timer, s64 tv64) |
| 204 | { | 201 | { |
| 205 | timer->_expires.tv64 = tv64; | 202 | timer->node.expires.tv64 = tv64; |
| 206 | timer->_softexpires.tv64 = tv64; | 203 | timer->_softexpires.tv64 = tv64; |
| 207 | } | 204 | } |
| 208 | 205 | ||
| 209 | static inline void hrtimer_add_expires(struct hrtimer *timer, ktime_t time) | 206 | static inline void hrtimer_add_expires(struct hrtimer *timer, ktime_t time) |
| 210 | { | 207 | { |
| 211 | timer->_expires = ktime_add_safe(timer->_expires, time); | 208 | timer->node.expires = ktime_add_safe(timer->node.expires, time); |
| 212 | timer->_softexpires = ktime_add_safe(timer->_softexpires, time); | 209 | timer->_softexpires = ktime_add_safe(timer->_softexpires, time); |
| 213 | } | 210 | } |
| 214 | 211 | ||
| 215 | static inline void hrtimer_add_expires_ns(struct hrtimer *timer, u64 ns) | 212 | static inline void hrtimer_add_expires_ns(struct hrtimer *timer, u64 ns) |
| 216 | { | 213 | { |
| 217 | timer->_expires = ktime_add_ns(timer->_expires, ns); | 214 | timer->node.expires = ktime_add_ns(timer->node.expires, ns); |
| 218 | timer->_softexpires = ktime_add_ns(timer->_softexpires, ns); | 215 | timer->_softexpires = ktime_add_ns(timer->_softexpires, ns); |
| 219 | } | 216 | } |
| 220 | 217 | ||
| 221 | static inline ktime_t hrtimer_get_expires(const struct hrtimer *timer) | 218 | static inline ktime_t hrtimer_get_expires(const struct hrtimer *timer) |
| 222 | { | 219 | { |
| 223 | return timer->_expires; | 220 | return timer->node.expires; |
| 224 | } | 221 | } |
| 225 | 222 | ||
| 226 | static inline ktime_t hrtimer_get_softexpires(const struct hrtimer *timer) | 223 | static inline ktime_t hrtimer_get_softexpires(const struct hrtimer *timer) |
| @@ -230,7 +227,7 @@ static inline ktime_t hrtimer_get_softexpires(const struct hrtimer *timer) | |||
| 230 | 227 | ||
| 231 | static inline s64 hrtimer_get_expires_tv64(const struct hrtimer *timer) | 228 | static inline s64 hrtimer_get_expires_tv64(const struct hrtimer *timer) |
| 232 | { | 229 | { |
| 233 | return timer->_expires.tv64; | 230 | return timer->node.expires.tv64; |
| 234 | } | 231 | } |
| 235 | static inline s64 hrtimer_get_softexpires_tv64(const struct hrtimer *timer) | 232 | static inline s64 hrtimer_get_softexpires_tv64(const struct hrtimer *timer) |
| 236 | { | 233 | { |
| @@ -239,12 +236,12 @@ static inline s64 hrtimer_get_softexpires_tv64(const struct hrtimer *timer) | |||
| 239 | 236 | ||
| 240 | static inline s64 hrtimer_get_expires_ns(const struct hrtimer *timer) | 237 | static inline s64 hrtimer_get_expires_ns(const struct hrtimer *timer) |
| 241 | { | 238 | { |
| 242 | return ktime_to_ns(timer->_expires); | 239 | return ktime_to_ns(timer->node.expires); |
| 243 | } | 240 | } |
| 244 | 241 | ||
| 245 | static inline ktime_t hrtimer_expires_remaining(const struct hrtimer *timer) | 242 | static inline ktime_t hrtimer_expires_remaining(const struct hrtimer *timer) |
| 246 | { | 243 | { |
| 247 | return ktime_sub(timer->_expires, timer->base->get_time()); | 244 | return ktime_sub(timer->node.expires, timer->base->get_time()); |
| 248 | } | 245 | } |
| 249 | 246 | ||
| 250 | #ifdef CONFIG_HIGH_RES_TIMERS | 247 | #ifdef CONFIG_HIGH_RES_TIMERS |
diff --git a/include/linux/timer.h b/include/linux/timer.h index 38cf093ef62c..6abd9138beda 100644 --- a/include/linux/timer.h +++ b/include/linux/timer.h | |||
| @@ -24,9 +24,9 @@ struct timer_list { | |||
| 24 | int slack; | 24 | int slack; |
| 25 | 25 | ||
| 26 | #ifdef CONFIG_TIMER_STATS | 26 | #ifdef CONFIG_TIMER_STATS |
| 27 | int start_pid; | ||
| 27 | void *start_site; | 28 | void *start_site; |
| 28 | char start_comm[16]; | 29 | char start_comm[16]; |
| 29 | int start_pid; | ||
| 30 | #endif | 30 | #endif |
| 31 | #ifdef CONFIG_LOCKDEP | 31 | #ifdef CONFIG_LOCKDEP |
| 32 | struct lockdep_map lockdep_map; | 32 | struct lockdep_map lockdep_map; |
| @@ -48,12 +48,38 @@ extern struct tvec_base boot_tvec_bases; | |||
| 48 | #define __TIMER_LOCKDEP_MAP_INITIALIZER(_kn) | 48 | #define __TIMER_LOCKDEP_MAP_INITIALIZER(_kn) |
| 49 | #endif | 49 | #endif |
| 50 | 50 | ||
| 51 | /* | ||
