filt_timerexpire_l(): re-insert restarted timer into head instead of tail

of the resumed timers list, so that kqtimer_proc_continue() does not
iterated into the same timer again.

PR:	293141
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
Differential revision:	https://reviews.freebsd.org/D55264
This commit is contained in:
Konstantin Belousov
2026-02-12 22:24:13 +02:00
parent bf149f2e88
commit 75a30ea09f
+6 -1
View File
@@ -873,8 +873,13 @@ filt_timerexpire_l(struct knote *kn, bool proc_locked)
PROC_LOCK(p);
if (P_SHOULDSTOP(p) || P_KILLED(p)) {
if ((kc->flags & KQ_TIMER_CB_ENQUEUED) == 0) {
/*
* Insert into head so that
* kqtimer_proc_continue() does not
* iterate into us again.
*/
kc->flags |= KQ_TIMER_CB_ENQUEUED;
TAILQ_INSERT_TAIL(&p->p_kqtim_stop, kc, link);
TAILQ_INSERT_HEAD(&p->p_kqtim_stop, kc, link);
}
if (!proc_locked)
PROC_UNLOCK(p);