aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier Certner <olce@FreeBSD.org>2026-06-13 14:19:18 +0000
committerOlivier Certner <olce@FreeBSD.org>2026-07-21 02:24:17 +0000
commit5217b4a728dc9fd72bc844c2a6bb30a2a28119c4 (patch)
tree9bae318bf3af6bccb2e2a41ad849d67183b6ec96
parente8dec0038bd95f6d940afa19b4d101f466280fd6 (diff)
sched_4bsd: Remove obsolete SMP scaling for ticks per priority level
The INVERSE_ESTCPU_WEIGHT scaling had been introduced by commit b698380f33ef ("Quick fix for scaling of statclock ticks in the SMP case. ...") to leave more discrimination room for multiple CPUs possibly adding their ticks to the same 'struct ksegrp' (but also slightly changing how CPU hogs are penalized). Then, commit 8460a577a4b4 ("Make KSE a kernel option, ...") introduced the current thread-based code, where tick accounting is only done on the current thread, which renders this trick obsolete on !KSE. Finally, when KSE was removed, the trick became generally obsolete. The trick is actually even harmful because it changes the intended behavior of priorizing more the CPUs that use the less ticks (and so, impairs boosting "interactive" processes). Remove it now. Clamping of 'ts_estcpu' and its relation to the load-average-based decay may be re-examined later. Fixes: 8460a577a4b4 ("Make KSE a kernel option, ...") MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D57827
-rw-r--r--sys/kern/sched_4bsd.c4
1 files changed, 0 insertions, 4 deletions
diff --git a/sys/kern/sched_4bsd.c b/sys/kern/sched_4bsd.c
index f86dcda218a4..98c5cd8836a8 100644
--- a/sys/kern/sched_4bsd.c
+++ b/sys/kern/sched_4bsd.c
@@ -70,11 +70,7 @@
* INVERSE_ESTCPU_WEIGHT is only suitable for statclock() frequencies in
* the range 100-256 Hz (approximately).
*/
-#ifdef SMP
-#define INVERSE_ESTCPU_WEIGHT (8 * smp_cpus)
-#else
#define INVERSE_ESTCPU_WEIGHT 8 /* 1 / (priorities per estcpu level). */
-#endif
#define NICE_WEIGHT 1 /* Priorities per nice level. */
#define ESTCPULIM(e) \
min((e), INVERSE_ESTCPU_WEIGHT * \