diff options
| author | Konstantin Belousov <kib@FreeBSD.org> | 2026-02-12 20:24:13 +0000 |
|---|---|---|
| committer | Konstantin Belousov <kib@FreeBSD.org> | 2026-02-13 15:46:41 +0000 |
| commit | 75a30ea09f4e75480743fae5c2369d50a6d8526c (patch) | |
| tree | ac4eb220c55a829cf5d2bf30eb0db6ace65e5dd1 | |
| parent | bf149f2e88cb3836e02ddabd9944eb58650a72ae (diff) | |
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
| -rw-r--r-- | sys/kern/kern_event.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/sys/kern/kern_event.c b/sys/kern/kern_event.c index a48408fd482a..85b7b6c953af 100644 --- a/sys/kern/kern_event.c +++ b/sys/kern/kern_event.c @@ -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); |
