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

Configure Feed

Select the types of activity you want to include in your feed.

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

+11 -12
+2 -3
include/linux/posix-timers.h
··· 150 150 * @it_active: Marker that timer is active 151 151 * @it_overrun: The overrun counter for pending signals 152 152 * @it_overrun_last: The overrun at the time of the last delivered signal 153 - * @it_requeue_pending: Indicator that timer waits for being requeued on 154 - * signal delivery 153 + * @it_signal_seq: Sequence count to control signal delivery 155 154 * @it_sigev_notify: The notify word of sigevent struct for signal delivery 156 155 * @it_interval: The interval for periodic timers 157 156 * @it_signal: Pointer to the creators signal struct ··· 171 172 int it_active; 172 173 s64 it_overrun; 173 174 s64 it_overrun_last; 174 - int it_requeue_pending; 175 + unsigned int it_signal_seq; 175 176 int it_sigev_notify; 176 177 ktime_t it_interval; 177 178 struct signal_struct *it_signal;
+1 -1
kernel/time/alarmtimer.c
··· 584 584 * small intervals cannot starve the system. 585 585 */ 586 586 ptr->it_overrun += __alarm_forward_now(alarm, ptr->it_interval, true); 587 - ++ptr->it_requeue_pending; 587 + ++ptr->it_signal_seq; 588 588 ptr->it_active = 1; 589 589 result = ALARMTIMER_RESTART; 590 590 }
+2 -2
kernel/time/posix-cpu-timers.c
··· 608 608 * ticking in case the signal is deliverable next time. 609 609 */ 610 610 posix_cpu_timer_rearm(timer); 611 - ++timer->it_requeue_pending; 611 + ++timer->it_signal_seq; 612 612 } 613 613 } 614 614 ··· 745 745 * - Timers which expired, but the signal has not yet been 746 746 * delivered 747 747 */ 748 - if (iv && ((timer->it_requeue_pending & REQUEUE_PENDING) || sigev_none)) 748 + if (iv && ((timer->it_signal_seq & REQUEUE_PENDING) || sigev_none)) 749 749 expires = bump_cpu_timer(timer, now); 750 750 else 751 751 expires = cpu_timer_getexpires(&timer->it.cpu);
+6 -6
kernel/time/posix-timers.c
··· 269 269 if (!timr) 270 270 goto out; 271 271 272 - if (timr->it_interval && timr->it_requeue_pending == info->si_sys_private) { 272 + if (timr->it_interval && timr->it_signal_seq == info->si_sys_private) { 273 273 timr->kclock->timer_rearm(timr); 274 274 275 275 timr->it_active = 1; 276 276 timr->it_overrun_last = timr->it_overrun; 277 277 timr->it_overrun = -1LL; 278 - ++timr->it_requeue_pending; 278 + ++timr->it_signal_seq; 279 279 280 280 info->si_overrun = timer_overrun_to_int(timr, info->si_overrun); 281 281 } ··· 299 299 300 300 timr->it_active = 0; 301 301 if (timr->it_interval) 302 - si_private = ++timr->it_requeue_pending; 302 + si_private = ++timr->it_signal_seq; 303 303 304 304 type = !(timr->it_sigev_notify & SIGEV_THREAD_ID) ? PIDTYPE_TGID : PIDTYPE_PID; 305 305 ret = send_sigqueue(timr->sigq, timr->it_pid, type, si_private); ··· 366 366 367 367 timr->it_overrun += hrtimer_forward(timer, now, timr->it_interval); 368 368 ret = HRTIMER_RESTART; 369 - ++timr->it_requeue_pending; 369 + ++timr->it_signal_seq; 370 370 timr->it_active = 1; 371 371 } 372 372 } ··· 660 660 * is a SIGEV_NONE timer move the expiry time forward by intervals, 661 661 * so expiry is > now. 662 662 */ 663 - if (iv && (timr->it_requeue_pending & REQUEUE_PENDING || sig_none)) 663 + if (iv && (timr->it_signal_seq & REQUEUE_PENDING || sig_none)) 664 664 timr->it_overrun += kc->timer_forward(timr, now); 665 665 666 666 remaining = kc->timer_remaining(timr, now); ··· 861 861 timer->it_interval = 0; 862 862 863 863 /* Prevent reloading in case there is a signal pending */ 864 - timer->it_requeue_pending = (timer->it_requeue_pending + 2) & ~REQUEUE_PENDING; 864 + timer->it_signal_seq = (timer->it_signal_seq + 2) & ~REQUEUE_PENDING; 865 865 /* Reset overrun accounting */ 866 866 timer->it_overrun_last = 0; 867 867 timer->it_overrun = -1LL;