mirror of
https://github.com/torvalds/linux.git
synced 2026-06-03 20:14:06 +02:00
posix-timers: Rename k_itimer:: It_requeue_pending
Prepare for using this struct member to do a proper reprogramming and deletion accounting so that stale signals can be dropped. No functional change. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Frederic Weisbecker <frederic@kernel.org> Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org> Link: https://lore.kernel.org/all/20241001083835.611997737@linutronix.de
This commit is contained in:
parent
2860d4d315
commit
cd1e93aeda
|
|
@ -150,8 +150,7 @@ static inline void posix_cputimers_init_work(void) { }
|
|||
* @it_active: Marker that timer is active
|
||||
* @it_overrun: The overrun counter for pending signals
|
||||
* @it_overrun_last: The overrun at the time of the last delivered signal
|
||||
* @it_requeue_pending: Indicator that timer waits for being requeued on
|
||||
* signal delivery
|
||||
* @it_signal_seq: Sequence count to control signal delivery
|
||||
* @it_sigev_notify: The notify word of sigevent struct for signal delivery
|
||||
* @it_interval: The interval for periodic timers
|
||||
* @it_signal: Pointer to the creators signal struct
|
||||
|
|
@ -172,7 +171,7 @@ struct k_itimer {
|
|||
int it_active;
|
||||
s64 it_overrun;
|
||||
s64 it_overrun_last;
|
||||
int it_requeue_pending;
|
||||
unsigned int it_signal_seq;
|
||||
int it_sigev_notify;
|
||||
ktime_t it_interval;
|
||||
struct signal_struct *it_signal;
|
||||
|
|
|
|||
|
|
@ -584,7 +584,7 @@ static enum alarmtimer_restart alarm_handle_timer(struct alarm *alarm,
|
|||
* small intervals cannot starve the system.
|
||||
*/
|
||||
ptr->it_overrun += __alarm_forward_now(alarm, ptr->it_interval, true);
|
||||
++ptr->it_requeue_pending;
|
||||
++ptr->it_signal_seq;
|
||||
ptr->it_active = 1;
|
||||
result = ALARMTIMER_RESTART;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -608,7 +608,7 @@ static void cpu_timer_fire(struct k_itimer *timer)
|
|||
* ticking in case the signal is deliverable next time.
|
||||
*/
|
||||
posix_cpu_timer_rearm(timer);
|
||||
++timer->it_requeue_pending;
|
||||
++timer->it_signal_seq;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -745,7 +745,7 @@ static void __posix_cpu_timer_get(struct k_itimer *timer, struct itimerspec64 *i
|
|||
* - Timers which expired, but the signal has not yet been
|
||||
* delivered
|
||||
*/
|
||||
if (iv && ((timer->it_requeue_pending & REQUEUE_PENDING) || sigev_none))
|
||||
if (iv && ((timer->it_signal_seq & REQUEUE_PENDING) || sigev_none))
|
||||
expires = bump_cpu_timer(timer, now);
|
||||
else
|
||||
expires = cpu_timer_getexpires(&timer->it.cpu);
|
||||
|
|
|
|||
|
|
@ -269,13 +269,13 @@ bool posixtimer_deliver_signal(struct kernel_siginfo *info)
|
|||
if (!timr)
|
||||
goto out;
|
||||
|
||||
if (timr->it_interval && timr->it_requeue_pending == info->si_sys_private) {
|
||||
if (timr->it_interval && timr->it_signal_seq == info->si_sys_private) {
|
||||
timr->kclock->timer_rearm(timr);
|
||||
|
||||
timr->it_active = 1;
|
||||
timr->it_overrun_last = timr->it_overrun;
|
||||
timr->it_overrun = -1LL;
|
||||
++timr->it_requeue_pending;
|
||||
++timr->it_signal_seq;
|
||||
|
||||
info->si_overrun = timer_overrun_to_int(timr, info->si_overrun);
|
||||
}
|
||||
|
|
@ -299,7 +299,7 @@ int posix_timer_queue_signal(struct k_itimer *timr)
|
|||
|
||||
timr->it_active = 0;
|
||||
if (timr->it_interval)
|
||||
si_private = ++timr->it_requeue_pending;
|
||||
si_private = ++timr->it_signal_seq;
|
||||
|
||||
type = !(timr->it_sigev_notify & SIGEV_THREAD_ID) ? PIDTYPE_TGID : PIDTYPE_PID;
|
||||
ret = send_sigqueue(timr->sigq, timr->it_pid, type, si_private);
|
||||
|
|
@ -366,7 +366,7 @@ static enum hrtimer_restart posix_timer_fn(struct hrtimer *timer)
|
|||
|
||||
timr->it_overrun += hrtimer_forward(timer, now, timr->it_interval);
|
||||
ret = HRTIMER_RESTART;
|
||||
++timr->it_requeue_pending;
|
||||
++timr->it_signal_seq;
|
||||
timr->it_active = 1;
|
||||
}
|
||||
}
|
||||
|
|
@ -660,7 +660,7 @@ void common_timer_get(struct k_itimer *timr, struct itimerspec64 *cur_setting)
|
|||
* is a SIGEV_NONE timer move the expiry time forward by intervals,
|
||||
* so expiry is > now.
|
||||
*/
|
||||
if (iv && (timr->it_requeue_pending & REQUEUE_PENDING || sig_none))
|
||||
if (iv && (timr->it_signal_seq & REQUEUE_PENDING || sig_none))
|
||||
timr->it_overrun += kc->timer_forward(timr, now);
|
||||
|
||||
remaining = kc->timer_remaining(timr, now);
|
||||
|
|
@ -861,7 +861,7 @@ void posix_timer_set_common(struct k_itimer *timer, struct itimerspec64 *new_set
|
|||
timer->it_interval = 0;
|
||||
|
||||
/* Prevent reloading in case there is a signal pending */
|
||||
timer->it_requeue_pending = (timer->it_requeue_pending + 2) & ~REQUEUE_PENDING;
|
||||
timer->it_signal_seq = (timer->it_signal_seq + 2) & ~REQUEUE_PENDING;
|
||||
/* Reset overrun accounting */
|
||||
timer->it_overrun_last = 0;
|
||||
timer->it_overrun = -1LL;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user