Beauties staggering timer interrupt
This is more or less a teaser patch. When we initialize local timer tick on AP (application processor), we prefer to stagger them. In a perfect world, the staggering should be evenly spaced within a jiffy for all the online cpu. And that's what majority of the code in ia64_cpu_local_tick() is trying to do. However, when it initialize itm_next, it didn't make any references to the AP's itm_next. So we end up with random staggering relative to AP's timer interrupt.
For platforms that has itc drift, this is not an issue since they going to be out of sync anyway. There is no point in trying to space them. But on box that has the itc synchronized, then current code is a bit suboptimal. (this probably explains why it is easier to expose a scheduler idle load balancing issue on ia64 compare to x86).
This patch will put the wonderful staggering calculation really in action.
arch/ia64/kernel/time.c renamed from arch/ia64/kernel/time.c.orig +3 -2
@@ -131,8 +131,9 @@ ia64_cpu_local_tick (void)if (cpu) {unsigned long hi =1UL <<ia64_fls (cpu); shift = (2 *(cpu - hi) +1 ) * delta/hi/2 ; - } - local_cpu_data->itm_next =ia64_get_itc () + delta + shift; + local_cpu_data->itm_next =cpu_data (0 )->itm_next + delta + shift; + }else + local_cpu_data->itm_next =ia64_get_itc () + delta;ia64_set_itm (local_cpu_data->itm_next); }
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line · Kenneth W
Ken> However, when it initialize itm_next, it didn't make any Ken> references to the AP's itm_next. So we end up with random Ken> staggering relative to AP's timer interrupt.
Good catch. You can move the declaration of "shift" inside the "if" then and drop its initialization.
--david