aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/hrtimer.h
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2011-03-10 12:26:33 -0500
committerThomas Gleixner <tglx@linutronix.de>2011-03-10 13:15:58 -0500
commit53370d2e8c0382e3e2aa76def93365ed674e7fc7 (patch)
tree531ed0d50c452332f5bc1b7d75539f24f532c326 /include/linux/hrtimer.h
parent5cd10e7946d28cfc42442fee2e6c757e244d756e (diff)
hrtimer: Update hrtimer->state documentation
We changed some of the state bits and combinations thereof over time, but never updated the documentation. Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'include/linux/hrtimer.h')
-rw-r--r--include/linux/hrtimer.h16
1 files changed, 11 insertions, 5 deletions
diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h
index 6bc1804bfbfa..62f500c724f9 100644
--- a/include/linux/hrtimer.h
+++ b/include/linux/hrtimer.h
@@ -54,11 +54,13 @@ enum hrtimer_restart {
54 * 0x00 inactive 54 * 0x00 inactive
55 * 0x01 enqueued into rbtree 55 * 0x01 enqueued into rbtree
56 * 0x02 callback function running 56 * 0x02 callback function running
57 * 0x04 timer is migrated to another cpu
57 * 58 *
58 * Special cases: 59 * Special cases:
59 * 0x03 callback function running and enqueued 60 * 0x03 callback function running and enqueued
60 * (was requeued on another CPU) 61 * (was requeued on another CPU)
61 * 0x09 timer was migrated on CPU hotunplug 62 * 0x05 timer was migrated on CPU hotunplug
63 *
62 * The "callback function running and enqueued" status is only possible on 64 * The "callback function running and enqueued" status is only possible on
63 * SMP. It happens for example when a posix timer expired and the callback 65 * SMP. It happens for example when a posix timer expired and the callback
64 * queued a signal. Between dropping the lock which protects the posix timer 66 * queued a signal. Between dropping the lock which protects the posix timer
@@ -67,8 +69,11 @@ enum hrtimer_restart {
67 * as otherwise the timer could be removed before the softirq code finishes the 69 * as otherwise the timer could be removed before the softirq code finishes the
68 * the handling of the timer. 70 * the handling of the timer.
69 * 71 *
70 * The HRTIMER_STATE_ENQUEUED bit is always or'ed to the current state to 72 * The HRTIMER_STATE_ENQUEUED bit is always or'ed to the current state
71 * preserve the HRTIMER_STATE_CALLBACK bit in the above scenario. 73 * to preserve the HRTIMER_STATE_CALLBACK in the above scenario. This
74 * also affects HRTIMER_STATE_MIGRATE where the preservation is not
75 * necessary. HRTIMER_STATE_MIGRATE is cleared after the timer is
76 * enqueued on the new cpu.
72 * 77 *
73 * All state transitions are protected by cpu_base->lock. 78 * All state transitions are protected by cpu_base->lock.
74 */ 79 */
@@ -376,8 +381,9 @@ extern int hrtimer_get_res(const clockid_t which_clock, struct timespec *tp);
376extern ktime_t hrtimer_get_next_event(void); 381extern ktime_t hrtimer_get_next_event(void);
377 382
378/* 383/*
379 * A timer is active, when it is enqueued into the rbtree or the callback 384 * A timer is active, when it is enqueued into the rbtree or the
380 * function is running. 385 * callback function is running or it's in the state of being migrated
386 * to another cpu.
381 */ 387 */
382static inline int hrtimer_active(const struct hrtimer *timer) 388static inline int hrtimer_active(const struct hrtimer *timer)
383{ 389{