Be more polite when setting state->nextevent inside cpu_new_callout().

Hardclock is not the only who wakes idle CPU since kdtrace cyclic addition.

MFC after:	2 weeks
This commit is contained in:
Alexander Motin 2012-03-09 07:30:48 +00:00
parent 6f4fc34468
commit 55c71d634f

View File

@ -854,10 +854,11 @@ cpu_new_callout(int cpu, int ticks)
* If timer is global - there is chance it is already programmed.
*/
if (periodic || (timer->et_flags & ET_FLAGS_PERCPU) == 0) {
state->nextevent = state->nexthard;
tmp = hardperiod;
bintime_mul(&tmp, ticks - 1);
bintime_add(&state->nextevent, &tmp);
bintime_add(&tmp, &state->nexthard);
if (bintime_cmp(&tmp, &state->nextevent, <))
state->nextevent = tmp;
if (periodic ||
bintime_cmp(&state->nextevent, &nexttick, >=)) {
ET_HW_UNLOCK(state);