Background: Local APIC timer stops functioning when CPU is in C3 state. As a
result the local APIC timer interrupt will fire at uncertain times, depending
on how long we spend in C3 state. And this has two side effects
* Idle balancing will not happen as we expect it to.
* Kernel statistics for idle time will not be proper (as we get less LAPIC
interrupts when we are idle). This can result in confusing other parts of
kernel (like ondemand cpufreq governor) which depends on this idle stats.
Proposed Fix: Attached is a prototype patch, that tries to eliminate the dependency on local APIC timer for update_process_times(). The patch gets rid of Local APIC timer altogether. We use the timer interrupt (IRQ 0) configured in broadcast mode in IOAPIC instead (Doesn't work with 8259). As changing anything related to basic timer interrupt is a little bit risky, I have a boot parameter currently ("useapictimer") to switch back to original local APIC timer way of doing things.
This may seem like a overkill to solve this particular problem. But, I feel
it simplifies things and will have other advantages:
* Should help dynamick tick as one has to change only global timer interrupt freq with varying jiffies.
* Reduces one interrupt per jiffy. * One less interrupt source to worry about.