From 8a0457508acf791b5b92d03dcf4d45ef0f92f413 Mon Sep 17 00:00:00 2001 From: cheloha Date: Sat, 9 Sep 2023 18:19:03 +0000 Subject: [PATCH] kernel: remove schedhz Now that alpha no longer sets schedhz, schedhz is a dead variable. Remove it. For now, leave the schedclock() call in place in statclock(). It still runs at its default rate of (stathz / 4). Part of mpi@'s WIP scheduler patch. Suggested by mpi@. Thread: https://marc.info/?l=openbsd-tech&m=169419781317781&w=2 ok mpi@ --- sys/kern/kern_clock.c | 12 ++++-------- sys/sys/sched.h | 3 +-- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/sys/kern/kern_clock.c b/sys/kern/kern_clock.c index 22b2d6043bc..1c8da764a31 100644 --- a/sys/kern/kern_clock.c +++ b/sys/kern/kern_clock.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_clock.c,v 1.115 2023/08/23 01:55:45 cheloha Exp $ */ +/* $OpenBSD: kern_clock.c,v 1.116 2023/09/09 18:19:03 cheloha Exp $ */ /* $NetBSD: kern_clock.c,v 1.34 1996/06/09 04:51:03 briggs Exp $ */ /*- @@ -79,7 +79,6 @@ */ int stathz; -int schedhz; int profhz; int profprocs; int ticks = INT_MAX - (15 * 60 * HZ); @@ -295,13 +294,10 @@ statclock(struct clockframe *frame) if (p != NULL) { p->p_cpticks++; /* - * If no schedclock is provided, call it here at ~~12-25 Hz; - * ~~16 Hz is best + * schedclock() runs every fourth statclock(). */ - if (schedhz == 0) { - if ((++spc->spc_schedticks & 3) == 0) - schedclock(p); - } + if ((++spc->spc_schedticks & 3) == 0) + schedclock(p); } } diff --git a/sys/sys/sched.h b/sys/sys/sched.h index 9b4e2789c63..d093e1e636c 100644 --- a/sys/sys/sched.h +++ b/sys/sys/sched.h @@ -1,4 +1,4 @@ -/* $OpenBSD: sched.h,v 1.61 2023/08/11 22:02:50 cheloha Exp $ */ +/* $OpenBSD: sched.h,v 1.62 2023/09/09 18:19:03 cheloha Exp $ */ /* $NetBSD: sched.h,v 1.2 1999/02/28 18:14:58 ross Exp $ */ /*- @@ -146,7 +146,6 @@ struct cpustats { #define ESTCPULIM(e) min((e), NICE_WEIGHT * PRIO_MAX - SCHED_PPQ) extern uint32_t roundrobin_period; -extern int schedhz; /* ideally: 16 */ struct proc; void schedclock(struct proc *); -- 2.20.1