Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 21 Jul 2026 02:26:54 +0000
From:      Olivier Certner <olce@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 5217b4a728dc - main - sched_4bsd: Remove obsolete SMP scaling for ticks per priority level
Message-ID:  <6a5ed8ee.21c4f.3395bd77@gitrepo.freebsd.org>

index | next in thread | raw e-mail

The branch main has been updated by olce:

URL: https://cgit.FreeBSD.org/src/commit/?id=5217b4a728dc9fd72bc844c2a6bb30a2a28119c4

commit 5217b4a728dc9fd72bc844c2a6bb30a2a28119c4
Author:     Olivier Certner <olce@FreeBSD.org>
AuthorDate: 2026-06-13 14:19:18 +0000
Commit:     Olivier Certner <olce@FreeBSD.org>
CommitDate: 2026-07-21 02:24:17 +0000

    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
---
 sys/kern/sched_4bsd.c | 4 ----
 1 file changed, 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 *				\


home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6a5ed8ee.21c4f.3395bd77>