diff options
author | Ingo Molnar <mingo@elte.hu> | 2009-07-03 08:29:34 -0500 |
---|---|---|
committer | Steven Rostedt <rostedt@rostedt.homelinux.com> | 2013-05-20 13:46:03 -0400 |
commit | 014badb2d9196e0995fb564c9ed113c32eac5c6d (patch) | |
tree | 3a20ea39e6921463e3945fdbc0d201bd6c70ee5c /include | |
parent | 4f350e327972b2a7a69adc1bbfb1fb0b74de2227 (diff) |
hrtimers: prepare full preemption
Make cancellation of a running callback in softirq context safe
against preemption.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/hrtimer.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h index cc07d2777bbe..75b2545d1e83 100644 --- a/include/linux/hrtimer.h +++ b/include/linux/hrtimer.h @@ -189,6 +189,9 @@ struct hrtimer_cpu_base { unsigned long nr_hangs; ktime_t max_hang_time; #endif +#ifdef CONFIG_PREEMPT_RT_BASE + wait_queue_head_t wait; +#endif struct hrtimer_clock_base clock_base[HRTIMER_MAX_CLOCK_BASES]; }; @@ -382,6 +385,13 @@ static inline int hrtimer_restart(struct hrtimer *timer) return hrtimer_start_expires(timer, HRTIMER_MODE_ABS); } +/* Softirq preemption could deadlock timer removal */ +#ifdef CONFIG_PREEMPT_RT_BASE + extern void hrtimer_wait_for_timer(const struct hrtimer *timer); +#else +# define hrtimer_wait_for_timer(timer) do { cpu_relax(); } while (0) +#endif + /* Query timers: */ extern ktime_t hrtimer_get_remaining(const struct hrtimer *timer); extern int hrtimer_get_res(const clockid_t which_clock, struct timespec *tp); |