diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2011-05-20 10:18:50 -0400 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2011-05-23 07:59:53 -0400 |
commit | 9ec2690758a5467f24beb301cca5098078073bba (patch) | |
tree | e5bc78f690d12635a56460ea6f54b49318221dc8 /include/linux | |
parent | 250f972d85effad5b6e10da4bbd877e6a4b503b6 (diff) |
timerfd: Manage cancelable timers in timerfd
Peter is concerned about the extra scan of CLOCK_REALTIME_COS in the
timer interrupt. Yes, I did not think about it, because the solution
was so elegant. I didn't like the extra list in timerfd when it was
proposed some time ago, but with a rcu based list the list walk it's
less horrible than the original global lock, which was held over the
list iteration.
Requested-by: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Peter Zijlstra <peterz@infradead.org>
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/hrtimer.h | 6 | ||||
-rw-r--r-- | include/linux/time.h | 6 | ||||
-rw-r--r-- | include/linux/timerfd.h | 4 |
3 files changed, 7 insertions, 9 deletions
diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h index eda4ccde0730..925c8c01db7b 100644 --- a/include/linux/hrtimer.h +++ b/include/linux/hrtimer.h | |||
@@ -155,7 +155,6 @@ enum hrtimer_base_type { | |||
155 | HRTIMER_BASE_REALTIME, | 155 | HRTIMER_BASE_REALTIME, |
156 | HRTIMER_BASE_MONOTONIC, | 156 | HRTIMER_BASE_MONOTONIC, |
157 | HRTIMER_BASE_BOOTTIME, | 157 | HRTIMER_BASE_BOOTTIME, |
158 | HRTIMER_BASE_REALTIME_COS, | ||
159 | HRTIMER_MAX_CLOCK_BASES, | 158 | HRTIMER_MAX_CLOCK_BASES, |
160 | }; | 159 | }; |
161 | 160 | ||
@@ -306,6 +305,11 @@ static inline int hrtimer_is_hres_active(struct hrtimer *timer) | |||
306 | #endif | 305 | #endif |
307 | 306 | ||
308 | extern void clock_was_set(void); | 307 | extern void clock_was_set(void); |
308 | #ifdef CONFIG_TIMERFD | ||
309 | extern void timerfd_clock_was_set(void); | ||
310 | #else | ||
311 | static inline void timerfd_clock_was_set(void) { } | ||
312 | #endif | ||
309 | extern void hrtimers_resume(void); | 313 | extern void hrtimers_resume(void); |
310 | 314 | ||
311 | extern ktime_t ktime_get(void); | 315 | extern ktime_t ktime_get(void); |
diff --git a/include/linux/time.h b/include/linux/time.h index a9242773eb24..b3061782dec3 100644 --- a/include/linux/time.h +++ b/include/linux/time.h | |||
@@ -302,12 +302,6 @@ struct itimerval { | |||
302 | * The IDs of various hardware clocks: | 302 | * The IDs of various hardware clocks: |
303 | */ | 303 | */ |
304 | #define CLOCK_SGI_CYCLE 10 | 304 | #define CLOCK_SGI_CYCLE 10 |
305 | |||
306 | #ifdef __KERNEL__ | ||
307 | /* This clock is not exposed to user space */ | ||
308 | #define CLOCK_REALTIME_COS 15 | ||
309 | #endif | ||
310 | |||
311 | #define MAX_CLOCKS 16 | 305 | #define MAX_CLOCKS 16 |
312 | #define CLOCKS_MASK (CLOCK_REALTIME | CLOCK_MONOTONIC) | 306 | #define CLOCKS_MASK (CLOCK_REALTIME | CLOCK_MONOTONIC) |
313 | #define CLOCKS_MONO CLOCK_MONOTONIC | 307 | #define CLOCKS_MONO CLOCK_MONOTONIC |
diff --git a/include/linux/timerfd.h b/include/linux/timerfd.h index e9571fc8f1a0..d3b57fa12225 100644 --- a/include/linux/timerfd.h +++ b/include/linux/timerfd.h | |||
@@ -19,7 +19,7 @@ | |||
19 | * shared O_* flags. | 19 | * shared O_* flags. |
20 | */ | 20 | */ |
21 | #define TFD_TIMER_ABSTIME (1 << 0) | 21 | #define TFD_TIMER_ABSTIME (1 << 0) |
22 | #define TFD_TIMER_CANCELON_SET (1 << 1) | 22 | #define TFD_TIMER_CANCEL_ON_SET (1 << 1) |
23 | #define TFD_CLOEXEC O_CLOEXEC | 23 | #define TFD_CLOEXEC O_CLOEXEC |
24 | #define TFD_NONBLOCK O_NONBLOCK | 24 | #define TFD_NONBLOCK O_NONBLOCK |
25 | 25 | ||
@@ -27,6 +27,6 @@ | |||
27 | /* Flags for timerfd_create. */ | 27 | /* Flags for timerfd_create. */ |
28 | #define TFD_CREATE_FLAGS TFD_SHARED_FCNTL_FLAGS | 28 | #define TFD_CREATE_FLAGS TFD_SHARED_FCNTL_FLAGS |
29 | /* Flags for timerfd_settime. */ | 29 | /* Flags for timerfd_settime. */ |
30 | #define TFD_SETTIME_FLAGS (TFD_TIMER_ABSTIME | TFD_TIMER_CANCELON_SET) | 30 | #define TFD_SETTIME_FLAGS (TFD_TIMER_ABSTIME | TFD_TIMER_CANCEL_ON_SET) |
31 | 31 | ||
32 | #endif /* _LINUX_TIMERFD_H */ | 32 | #endif /* _LINUX_TIMERFD_H */ |