git: 119af90d483a - stable/14 - 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:23:02 UTC
The branch stable/14 has been updated by kib:

URL: https://cgit.FreeBSD.org/src/commit/?id=119af90d483aee79bf549b3d63e1093bb59e1092

commit 119af90d483aee79bf549b3d63e1093bb59e1092
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:19:30 +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 835a22c81528..869c4cf24ddb 100644
--- a/sys/kern/kern_event.c
+++ b/sys/kern/kern_event.c
@@ -769,8 +769,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);