posix-cpu-timers: Cleanup the firing logic
authorThomas Gleixner <tglx@linutronix.de>
Tue, 5 Nov 2024 08:14:33 +0000 (09:14 +0100)
committerThomas Gleixner <tglx@linutronix.de>
Thu, 7 Nov 2024 01:14:43 +0000 (02:14 +0100)
commitbf635681c906ad056d1fda325de8d1c12c9f8201
tree5186970b315513cf7bc6ab81efcdfe53b9f93408
parentb06b0345fff3678517acd0f1837d52477ba30944
posix-cpu-timers: Cleanup the firing logic

The firing flag of a posix CPU timer is tristate:

  0: when the timer is not about to deliver a signal

  1: when the timer has expired, but the signal has not been delivered yet

 -1: when the timer was queued for signal delivery and a rearm operation
     raced against it and supressed the signal delivery.

This is a pointless exercise as this can be simply expressed with a
boolean. Only if set, the signal is delivered. This makes delete and rearm
consistent with the rest of the posix timers.

Convert firing to bool and fixup the usage sites accordingly and add
comments why the timer cannot be dequeued right away.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Frederic Weisbecker <frederic@kernel.org>
Link: https://lore.kernel.org/all/20241105064213.172848618@linutronix.de
include/linux/posix-timers.h
kernel/time/posix-cpu-timers.c