Page MenuHomeFreeBSD

sched: fix kern.sched.{4bsd,ule}.slice
ClosedPublic

Authored by mchoo on Fri, Sep 4, 5:37 PM.
Tags
None
Referenced Files
F174121271: D59401.diff
Wed, Sep 30, 6:39 PM
F174108613: D59401.id.diff
Wed, Sep 30, 4:45 PM
F174102075: D59401.diff
Wed, Sep 30, 3:43 PM
F174095891: D59401.id.diff
Wed, Sep 30, 2:34 PM
Unknown Object (File)
Tue, Sep 29, 12:37 AM
Unknown Object (File)
Sun, Sep 27, 3:45 PM
Unknown Object (File)
Sat, Sep 26, 12:46 PM
Unknown Object (File)
Sat, Sep 26, 4:35 AM
Subscribers

Details

Summary

Fix three problems with kern.sched.{4bsd,ule}.slice:

  • Guarantee minimum slice is 1.
  • Recalculate hogticks on sysctl write.
  • For ULE, recalculate sched_slice_min on sysctl write.

MFC after: 2 weeks
MFC to: stable/14, stable/15
Sponsored by: FreeBSD Foundation

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

mchoo requested review of this revision.Fri, Sep 4, 5:37 PM
olce requested changes to this revision.Sun, Sep 6, 4:38 PM
olce added inline comments.
sys/kern/sched_4bsd.c
215

It's an internal function, no need to have 4bsd_ in the name.

Additionally, I'm planning to rename back all implementations of the current interface (to the rest of the kernel) to their prior names, that is, with ule_ or 4bsd_ removed, relatively soon (but there is EuroBSDCon next week).

225

Not necessary given the previous test. Replace by an assertion?

226–227

Could you please factor out the hogticks computation and setting in a separate function, and use it throughout the file (preferably as a separate commit)?

sys/kern/sched_ule.c
3490–3502

Same comments as for 4BSD.

This revision now requires changes to proceed.Sun, Sep 6, 4:38 PM

Remove unnecessary imax()

sys/kern/sched_4bsd.c
215

Since sysctl_kern_4bsd_quantum already has the namespace, I'll keep it for now. It can be renamed when the cleanup is done across 4BSD and ULE.

225

I think assertion is unnecessary here.

sys/kern/sched_ule.c
3499

D59408 adds imax() check for quantum sysctl.

sys/kern/sched_4bsd.c
215

Let's go right now in the intended direction. Additionally, having 4bsd_ here and no ule_ below is inconsistent. So please remove it.

mchoo added inline comments.
sys/kern/sched_4bsd.c
226–227

Done in D59471

This revision is now accepted and ready to land.Tue, Sep 8, 7:49 AM
This revision was automatically updated to reflect the committed changes.
mchoo marked an inline comment as done.