MFC after: 2 weeks
Sponsored by: FreeBSD Foundation
Details
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
Remove kern.sched.preemption (This is shared between 4BSD and ULE, so it should be in scheduler.4)
It's really nice to move it from here in the commit where you're adding that, that way you're not creating a state where that part of the docs is temporarily missing.
It's better in general, but that does not always happen (see discussion we had in D54881). Minsoo has nothing to do with the situation here, the change was introduced in eb454937a3c0 ("sys: Move ULE sysctls under kern.sched.ule"), so if anyone is to blame, it's kib@ and in part myself as a reviewer (and I did bad when approving the change, on multiple levels).
Looks good overall. See inline comments for reformulations/suggestions. Also, I would suggest moving kern.sched.*.quantum and kern.sched.*.slice into scheduler.4.
| share/man/man4/sched_4bsd.4 | ||
|---|---|---|
| 65–66 | We should reserve the word "runqueue" for the full structure, and "queue" for the thread list at a given index/priority level. Also, the proposed comment was unclear in that the knob actually *controls* whether we prefer a thread that last ran on the CPU. | |
| share/man/man4/sched_ule.4 | ||
| 72 | This perhaps reads a bit too terse because a smaller numerical priority is actually a higher priority. If keeping it that concise, I'd be tempted to use "above" instead of below, but that could be even more confusing. Perhaps something along the lines of: The numerical priority threshold (not included) below which preemption is allowed. Threads with numerically-lower priority values have higher priority. | |
| 74 | Description is not correct. Suggestion. | |
| 90–97 | I'd order the knobs like this as this make more sense:
| |
| sys/kern/sched_4bsd.c | ||
| 236 ↗ | (On Diff #187687) | |
| sys/kern/sched_ule.c | ||
| 3508 ↗ | (On Diff #187687) | (Same.) |
| share/man/man4/sched_ule.4 | ||
|---|---|---|
| 72 | I used the word "non-inclusive". | |
I wouldn't do that for two reasons:
- I want to strictly separate kern.sched.4bsd.* into sched_4bsd.4 and kern.sched.ule.* into sched_ule.4. It's repetitive but easier to find for users.
- Schedulers introduced in future might have a different notion of "quantum". 4BSD and ULE share the same meaning, but for EEVDF's quantum is not an absolute measure. Quantum (or time slice) in EEVDF is scaled by weight.
Quantum is not an absolute measure in ULE. Supporting hybrid architectures requires weighting quantums, even if these weights are not EEVDF's weights, which are about relative priority. Even forgetting about such architectures, ULE typically does not need to change the quantum to account for relative priority, but it will change it depending on the load (number of threads to schedule on current CPU). Actually, "quantum base" would be more appropriate, and can fit what EEVDF's slices are as well. But then, the exact usage of that base indeed depends on the precise implementation.