When global timer used at SMP system, update nextevent field on BSP before
sending IPI to other CPUs. Otherwise, other CPUs will try to honor stale value, programming timer for zero interval. If timer is fast enough, it caused extra interrupt before timer correctly reprogrammed by BSP.
This commit is contained in:
parent
84d6709378
commit
a168297469
@ -335,15 +335,15 @@ timercb(struct eventtimer *et, void *arg)
|
||||
bcast = 0;
|
||||
if ((et->et_flags & ET_FLAGS_PERCPU) == 0 && smp_started) {
|
||||
CPU_FOREACH(cpu) {
|
||||
if (curcpu == cpu)
|
||||
continue;
|
||||
state = DPCPU_ID_PTR(cpu, timerstate);
|
||||
ET_HW_LOCK(state);
|
||||
state->now = now;
|
||||
if (bintime_cmp(&now, &state->nextevent, >=)) {
|
||||
state->nextevent.sec++;
|
||||
state->ipi = 1;
|
||||
bcast = 1;
|
||||
if (curcpu != cpu) {
|
||||
state->ipi = 1;
|
||||
bcast = 1;
|
||||
}
|
||||
}
|
||||
ET_HW_UNLOCK(state);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user