Page MenuHomeFreeBSD

sched_4bsd: add static assertion for nice weight
AcceptedPublic

Authored by mchoo on Fri, Sep 4, 5:36 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Sep 4, 11:03 PM
Unknown Object (File)
Fri, Sep 4, 9:53 PM
Unknown Object (File)
Fri, Sep 4, 9:36 PM
Subscribers

Details

Reviewers
jhb
olce
Group Reviewers
scheduler
Summary

When NICE_WEIGHT * (PRIO_MAX - PRIO_MIN) exceeds the timeshare range,
two CPU-bound threads with different nice values can have the same
priority as their nice values are clamped to the timeshare range limit.
Add static assertion on NICE_WEIGHT to ensure that there is always
enough room for nice values in the both end of the timeshare priority
range.

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

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 76504
Build 73387: arc lint + arc unit

Event Timeline

mchoo requested review of this revision.Fri, Sep 4, 5:36 PM

Please rephrase though the assertion description (see inline comment).

sys/kern/sched_4bsd.c
77

I'd suggest rephrasing this to be more high-level (in general, the text should not repeat what can be readily inferred from the test itself to have enough added value).

This revision is now accepted and ready to land.Sun, Sep 6, 4:14 PM