From c7aa0304d5b5443340fc7920975743cfe2c0fca3 Mon Sep 17 00:00:00 2001 From: John Baldwin Date: Thu, 21 Apr 2022 10:40:01 -0700 Subject: [PATCH] Run softclock threads at a hardware ithread priority. Add a new PI_SOFTCLOCK for use by softclock threads. Currently this maps to PI_AV which is the second-highest ithread priority. Reviewed by: mav, kib Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D33693 --- sys/kern/kern_timeout.c | 2 +- sys/sys/priority.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/kern/kern_timeout.c b/sys/kern/kern_timeout.c index db4217114c3..121ee2b13f4 100644 --- a/sys/kern/kern_timeout.c +++ b/sys/kern/kern_timeout.c @@ -393,7 +393,7 @@ start_softclock(void *dummy) cc->cc_thread = td; thread_lock(td); sched_class(td, PRI_ITHD); - sched_prio(td, PI_SWI(SWI_CLOCK)); + sched_prio(td, PI_SOFTCLOCK); TD_SET_IWAIT(td); thread_lock_set(td, (struct mtx *)&cc->cc_lock); thread_unlock(td); diff --git a/sys/sys/priority.h b/sys/sys/priority.h index 60327cf2029..428be2d02c6 100644 --- a/sys/sys/priority.h +++ b/sys/sys/priority.h @@ -87,6 +87,7 @@ #define PI_REALTIME (PRI_MIN_ITHD + 0) #define PI_AV (PRI_MIN_ITHD + 4) +#define PI_SOFTCLOCK PI_AV #define PI_NET (PRI_MIN_ITHD + 8) #define PI_DISK (PRI_MIN_ITHD + 12) #define PI_TTY (PRI_MIN_ITHD + 16)