From c7a8681c1a04a1cf6e98bf9d4ca5216e19cc4c2e Mon Sep 17 00:00:00 2001 From: cheloha Date: Sat, 9 Sep 2023 16:34:39 +0000 Subject: [PATCH] clockintr_advance: delete duplicate code, call clockintr_schedule_locked() Replace a bunch of code in clockintr_advance() with just one call to clockintr_schedule_locked() -- everyone's favorite hot new subroutine. --- sys/kern/kern_clockintr.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/sys/kern/kern_clockintr.c b/sys/kern/kern_clockintr.c index ffaf1567ea0..d219f05c219 100644 --- a/sys/kern/kern_clockintr.c +++ b/sys/kern/kern_clockintr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_clockintr.c,v 1.42 2023/09/09 16:20:48 cheloha Exp $ */ +/* $OpenBSD: kern_clockintr.c,v 1.43 2023/09/09 16:34:39 cheloha Exp $ */ /* * Copyright (c) 2003 Dale Rahn * Copyright (c) 2020 Mark Kettenis @@ -332,17 +332,7 @@ clockintr_advance(struct clockintr *cl, uint64_t period) mtx_enter(&cq->cq_mtx); expiration = cl->cl_expiration; count = nsec_advance(&expiration, period, nsecuptime()); - if (ISSET(cl->cl_flags, CLST_PENDING)) - clockqueue_pend_delete(cq, cl); - clockqueue_pend_insert(cq, cl, expiration); - if (ISSET(cq->cq_flags, CQ_INTRCLOCK)) { - if (cl == TAILQ_FIRST(&cq->cq_pend)) { - if (cq == &curcpu()->ci_queue) - clockqueue_reset_intrclock(cq); - } - } - if (cl == cq->cq_running) - SET(cl->cl_flags, CLST_IGNORE_SHADOW); + clockintr_schedule_locked(cl, expiration); mtx_leave(&cq->cq_mtx); return count; } -- 2.20.1