HomeFreeBSD

sched_ule(4): Fix possible significance loss.

Description

sched_ule(4): Fix possible significance loss.

Before this change kern.sched.interact sysctl setting above 32 gave
all interactive threads identical priority of PRI_MIN_INTERACT due to
((PRI_MAX_INTERACT - PRI_MIN_INTERACT + 1) / sched_interact) turning
zero. Setting the sysctl lower reduced the range of used priority
levels up to half, that is not great either.

Change of the operations order should fix the issue, always using full
range of priorities, while overflow is impossible there since both
score and priority values are small. While there, make the variables
unsigned as they really are.

MFC after: 1 month

Details

Provenance
mavAuthored on Oct 2 2021, 3:47 AM
Parents
rG93d120dbc0d0: contrib/tzdata: import tzdata 2021c
Branches
Unknown
Tags
Unknown