git: 22bf122dceb7 - stable/15 - filt_timerexpire_l(): re-insert restarted timer into head instead of tail

From: Konstantin Belousov <kib_at_FreeBSD.org>
Date: Mon, 16 Feb 2026 06:18:41 UTC
The branch stable/15 has been updated by kib:

URL: https://cgit.FreeBSD.org/src/commit/?id=22bf122dceb73f194c258b32d657088e3e02fe3b

commit 22bf122dceb73f194c258b32d657088e3e02fe3b
Author:     Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2026-02-12 20:24:13 +0000
Commit:     Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2026-02-16 06:13:59 +0000

    filt_timerexpire_l(): re-insert restarted timer into head instead of tail
    
    PR:     293141
    
    (cherry picked from commit 75a30ea09f4e75480743fae5c2369d50a6d8526c)
---
 sys/kern/kern_event.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

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);