- Check whether we've recorded this tick in ts_ticks on another cpu in

sched_tick() to prevent multiple increments for one tick.  This pushes
   the value out of range and breaks priority calculation.

Reviewed by:	kib
Found by:	pho/nokia
Sponsored by:	Nokia
MFC after:	3 days
This commit is contained in:
Jeff Roberson 2008-07-19 05:13:47 +00:00
parent ad8abd6c4d
commit e980fff622

View File

@ -2163,6 +2163,12 @@ sched_tick(void)
struct td_sched *ts;
ts = curthread->td_sched;
/*
* Ticks is updated asynchronously on a single cpu. Check here to
* avoid incrementing ts_ticks multiple times in a single tick.
*/
if (ts->ts_ltick == ticks)
return;
/* Adjust ticks for pctcpu */
ts->ts_ticks += 1 << SCHED_TICK_SHIFT;
ts->ts_ltick = ticks;