aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKonstantin Belousov <kib@FreeBSD.org>2026-01-24 06:01:48 +0000
committerKonstantin Belousov <kib@FreeBSD.org>2026-01-29 18:11:56 +0000
commita84a39dfe5d1fd98afdf29a74017fce29441b730 (patch)
tree2c1e993d191e2c615bcdb8274fdb9f40f0a35ec7
parent1322760fd1274930cbb61048d9a6ba3bc1782b2a (diff)
kern/sched: move duplicate preemption stat vars into sched_shim.c
Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D54831
-rw-r--r--sys/kern/sched_4bsd.c4
-rw-r--r--sys/kern/sched_shim.c5
-rw-r--r--sys/kern/sched_ule.c4
-rw-r--r--sys/sys/sched.h3
4 files changed, 8 insertions, 8 deletions
diff --git a/sys/kern/sched_4bsd.c b/sys/kern/sched_4bsd.c
index 4c24d98173f3..55a70885ee28 100644
--- a/sys/kern/sched_4bsd.c
+++ b/sys/kern/sched_4bsd.c
@@ -706,10 +706,6 @@ sched_4bsd_rr_interval(void)
return (imax(1, (sched_slice * hz + realstathz / 2) / realstathz));
}
-SCHED_STAT_DEFINE(ithread_demotions, "Interrupt thread priority demotions");
-SCHED_STAT_DEFINE(ithread_preemptions,
- "Interrupt thread preemptions due to time-sharing");
-
/*
* We adjust the priority of the current process. The priority of a
* process gets worse as it accumulates CPU time. The cpu usage
diff --git a/sys/kern/sched_shim.c b/sys/kern/sched_shim.c
index f6b1285830fd..9d96c1a2d550 100644
--- a/sys/kern/sched_shim.c
+++ b/sys/kern/sched_shim.c
@@ -97,6 +97,11 @@ DEFINE_SHIM0(do_timer_accounting, bool, sched_do_timer_accounting)
DEFINE_SHIM1(find_l2_neighbor, int, sched_find_l2_neighbor, int, cpu)
DEFINE_SHIM0(init_ap, void, schedinit_ap)
+
+SCHED_STAT_DEFINE(ithread_demotions, "Interrupt thread priority demotions");
+SCHED_STAT_DEFINE(ithread_preemptions,
+ "Interrupt thread preemptions due to time-sharing");
+
static char sched_name[32] = "ULE";
SET_DECLARE(sched_instance_set, struct sched_selection);
diff --git a/sys/kern/sched_ule.c b/sys/kern/sched_ule.c
index 334b3c0f1de3..201d9c33dda7 100644
--- a/sys/kern/sched_ule.c
+++ b/sys/kern/sched_ule.c
@@ -2693,10 +2693,6 @@ sched_ule_userret_slowpath(struct thread *td)
thread_unlock(td);
}
-SCHED_STAT_DEFINE(ithread_demotions, "Interrupt thread priority demotions");
-SCHED_STAT_DEFINE(ithread_preemptions,
- "Interrupt thread preemptions due to time-sharing");
-
/*
* Return time slice for a given thread. For ithreads this is
* sched_slice. For other threads it is tdq_slice(tdq).
diff --git a/sys/sys/sched.h b/sys/sys/sched.h
index 3ba40fb191d3..bc8022084de3 100644
--- a/sys/sys/sched.h
+++ b/sys/sys/sched.h
@@ -231,6 +231,9 @@ SYSINIT(name, SI_SUB_LAST, SI_ORDER_MIDDLE, name ## _add_proc, NULL);
#define SCHED_STAT_INC(var) (void)0
#endif
+SCHED_STAT_DECLARE(ithread_demotions);
+SCHED_STAT_DECLARE(ithread_preemptions);
+
/*
* Fixup scheduler state for proc0 and thread0
*/