Figure 1521 Overview of the situation when broadcasting replaces nonfunctional tick devices

The APIC devices are not functional, but the broadcast event device still is. tick_handle_periodic_ broadcast is used as the event handler. It deals with both periodic and one-shot modes of the broadcast device, so this need not concern us any further. The handler will be activated after each tick_period.

The broadcast handler uses tick_do_periodic_broadcast. The code flow diagram is shown in Figure 15-22. The function invokes the event_handler method of the nonfunctional device on the current CPU. The handler cannot distinguish if it was invoked from a clock interrupt or from the broadcast device, and is thus executed as if the underlying event device were functional.

If there are more nonfunctional local tick devices, then tick_do_broadcast employs the broadcast method of the first device in the list.21 For local APICs, the broadcast method is lapic_timer_broadcast. It is responsible to send the inter-processor interrupt (IPI) local_timer_vector to all CPUs that are associated with nonfunctional tick devices. The vector has been set up by the kernel to call

21 This is possible because at the moment the same broadcast handler is installed on all devices that can become nonfunctional.

apic_timer_interrupt. The result is that the clock event device cannot distinguish between IPIs and real interrupts, so the effect is the same as if the device were still functional.

Figure 15-22: Code flow diagram for tick_do_periodic_broadcast.

Inter-processor interrupts are slow, and thus the required accuracy and resolution for high-resolution timers will not be available. The kernel therefore always switches to low-resolution mode if broadcasting is required.

Continue reading here: Time Bases

Was this article helpful?

0 0