git: a4f40ac17dfe - stable/14 - sched_4bsd: move comment to correct location
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 02 Oct 2026 15:50:01 UTC
The branch stable/14 has been updated by mchoo:
URL: https://cgit.FreeBSD.org/src/commit/?id=a4f40ac17dfef9dd7e1924ca73fff2fd394768f0
commit a4f40ac17dfef9dd7e1924ca73fff2fd394768f0
Author: Minsoo Choo <mchoo@FreeBSD.org>
AuthorDate: 2026-08-24 02:25:36 +0000
Commit: Minsoo Choo <mchoo@FreeBSD.org>
CommitDate: 2026-10-02 15:44:53 +0000
sched_4bsd: move comment to correct location
Reviewed by: olce
Approved by: olce (mentor)
MFC after: 2 weeks
Sponsored by: FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D59403
(cherry picked from commit 039498c2735ee0697da24b9c60c9e67680f91f31)
---
sys/kern/sched_4bsd.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/sys/kern/sched_4bsd.c b/sys/kern/sched_4bsd.c
index a54e96967ec5..32f0fa6696b5 100644
--- a/sys/kern/sched_4bsd.c
+++ b/sys/kern/sched_4bsd.c
@@ -515,11 +515,6 @@ schedcpu(void)
* ts_pctcpu is only for ps and ttyinfo().
*/
ts->ts_pctcpu = (ts->ts_pctcpu * ccpu) >> FSHIFT;
- /*
- * If the td_sched has been idle the entire second,
- * stop recalculating its priority until
- * it wakes up.
- */
if (ts->ts_cpticks != 0) {
#if (FSHIFT >= CCPU_SHIFT)
ts->ts_pctcpu += (realstathz == 100)
@@ -555,6 +550,12 @@ schedcpu(void)
ts->ts_slptime = 0;
} else
ts->ts_slptime++;
+
+ /*
+ * If the td_sched has been idle the entire second,
+ * stop recalculating its priority until
+ * it wakes up.
+ */
if (ts->ts_slptime > 1) {
thread_unlock(td);
continue;