git: b74d31398a24 - stable/15 - sched_4bsd: fix vague comment
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 02 Oct 2026 15:35:09 UTC
The branch stable/15 has been updated by mchoo:
URL: https://cgit.FreeBSD.org/src/commit/?id=b74d31398a240c341cc52c41551d38ac5a541b20
commit b74d31398a240c341cc52c41551d38ac5a541b20
Author: Minsoo Choo <mchoo@FreeBSD.org>
AuthorDate: 2026-08-24 02:25:37 +0000
Commit: Minsoo Choo <mchoo@FreeBSD.org>
CommitDate: 2026-10-02 15:34:31 +0000
sched_4bsd: fix vague comment
The comment "was incremented in schedcpu()" doesn't give enough
background for decrementing ts_slptime by 1 (thus ignoring decay_cpu()
for 1 ts_slptime). More accurately, ts_slptime is decremented by 1
because decay_cpu() has already executed once in schedcpu() when
ts_slptime was 1.
Reviewed by: olce
Approved by: olce (mentor)
MFC after: 2 weeks
Sponsored by: FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D59406
(cherry picked from commit cd33abbce5a5c3b454f00ca3d0ecd71c2234106c)
---
sys/kern/sched_4bsd.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/sys/kern/sched_4bsd.c b/sys/kern/sched_4bsd.c
index 27fbd3c5bdca..cd039501b609 100644
--- a/sys/kern/sched_4bsd.c
+++ b/sys/kern/sched_4bsd.c
@@ -585,7 +585,8 @@ updatepri(struct thread *td)
ts->ts_estcpu = 0;
else {
newcpu = ts->ts_estcpu;
- ts->ts_slptime--; /* was incremented in schedcpu() */
+ /* schedcpu() performs one decay_cpu() on its own. */
+ ts->ts_slptime--;
while (newcpu && --ts->ts_slptime)
newcpu = decay_cpu(loadfac, newcpu);
ts->ts_estcpu = newcpu;