- Cast the intermediate value in priority computtion back down to
unsigned char. Weirdly, casting the 1 constant to u_char still produces a signed integer result that is then used in the % computation. This avoids that mess all together and causes a 0 pri to turn into 255 % 64 as we expect. Reported by: kkenn (about 4 times, thanks)
This commit is contained in:
parent
1008dd40e3
commit
82143f95ad
@ -388,7 +388,7 @@ tdq_runq_add(struct tdq *tdq, struct td_sched *ts, int flags)
|
||||
*/
|
||||
if (tdq->tdq_ridx != tdq->tdq_idx &&
|
||||
pri == tdq->tdq_ridx)
|
||||
pri = (pri - 1) % RQ_NQS;
|
||||
pri = (unsigned char)(pri - 1) % RQ_NQS;
|
||||
} else
|
||||
pri = tdq->tdq_ridx;
|
||||
runq_add_pri(ts->ts_runq, ts, pri, flags);
|
||||
|
Loading…
x
Reference in New Issue
Block a user