[PATCH 1/4] tickless idle cpu - Allow any CPU to update jiffies

Paul Mackerras paulus at samba.org
Sat Apr 8 09:04:15 EST 2006


Srivatsa Vaddagiri writes:

> Currently, only boot CPU calls do_timer to update jiffies. This prevents
> idle boot CPU from skipping ticks. Patch below, against 2.6.17-rc1-mm1,
> allows jiffies to be updated from any CPU.

We have to be very careful here.  The code that keeps xtime and
gettimeofday in sync relies on xtime being incremented as close as
possible in time to when the timebase passes specific values.  Since
we currently stagger the timer interrupts for the cpus throughout a
jiffy, having cpus other than the boot cpus calling do_timer will
break this and introduce inaccuracies.  There are also implications
for the stolen time accounting on shared-processor LPAR systems.

I think we need to remove the staggering, thus having all cpus take
their timer interrupt at the same time.  That way, any of them can
call do_timer.  However we then have to be much more careful about
possible contention, e.g. on xtime_lock.  Your patch has every cpu
taking xtime_lock for writing rather than just the boot cpu.  I'd like
to see if there is some way to avoid that (while still having just one
cpu call do_timer, of course).

Regards,
Paul.



More information about the Linuxppc-dev mailing list