]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
sched_ule(4): Fix possible significance loss.
authorAlexander Motin <mav@FreeBSD.org>
Sat, 2 Oct 2021 03:47:18 +0000 (23:47 -0400)
committerAlexander Motin <mav@FreeBSD.org>
Sat, 2 Oct 2021 04:09:45 +0000 (00:09 -0400)
commit1c119e173ddc7f5603a3b6cf940dc524e494a667
tree4afbe672fa2c36cc465f50dffac20c9f223a191b
parent93d120dbc0d039ebd3d421aad169b6a2e3ac7dbe
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
sys/kern/sched_ule.c