Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

+11 -5
+11 -5
include/linux/hrtimer.h
··· 54 54 * 0x00 inactive 55 55 * 0x01 enqueued into rbtree 56 56 * 0x02 callback function running 57 + * 0x04 timer is migrated to another cpu 57 58 * 58 59 * Special cases: 59 60 * 0x03 callback function running and enqueued 60 61 * (was requeued on another CPU) 61 - * 0x09 timer was migrated on CPU hotunplug 62 + * 0x05 timer was migrated on CPU hotunplug 63 + * 62 64 * The "callback function running and enqueued" status is only possible on 63 65 * SMP. It happens for example when a posix timer expired and the callback 64 66 * queued a signal. Between dropping the lock which protects the posix timer ··· 69 67 * as otherwise the timer could be removed before the softirq code finishes the 70 68 * the handling of the timer. 71 69 * 72 - * The HRTIMER_STATE_ENQUEUED bit is always or'ed to the current state to 73 - * preserve the HRTIMER_STATE_CALLBACK bit in the above scenario. 70 + * The HRTIMER_STATE_ENQUEUED bit is always or'ed to the current state 71 + * to preserve the HRTIMER_STATE_CALLBACK in the above scenario. This 72 + * also affects HRTIMER_STATE_MIGRATE where the preservation is not 73 + * necessary. HRTIMER_STATE_MIGRATE is cleared after the timer is 74 + * enqueued on the new cpu. 74 75 * 75 76 * All state transitions are protected by cpu_base->lock. 76 77 */ ··· 381 376 extern ktime_t hrtimer_get_next_event(void); 382 377 383 378 /* 384 - * A timer is active, when it is enqueued into the rbtree or the callback 385 - * function is running. 379 + * A timer is active, when it is enqueued into the rbtree or the 380 + * callback function is running or it's in the state of being migrated 381 + * to another cpu. 386 382 */ 387 383 static inline int hrtimer_active(const struct hrtimer *timer) 388 384 {