[PATCH] NO_IDLE_HZ implementation for PPC64

Srivatsa Vaddagiri vatsa at in.ibm.com
Tue Oct 4 02:18:51 EST 2005


On Mon, Oct 03, 2005 at 06:08:12PM +1000, Benjamin Herrenschmidt wrote:
> I don't think we care that much which CPU updates xtime and jiffies. I
> would love xtime to die anyway, kernel should get do_gettimeofday()
> internally. On ppc64, we only seldomly update xtime. Doing it on CPU0
> was, I suppose, a matter of simplicity of the implementation.

Ok, in that case I will fix that as well in the next version of the patch.

> I think C code is good enough, you probably only need need to add a call
> to do_IRQ(). The decrementer interrupt should naturally playback lost
> ticks.

Aren't other exceptions possible when a CPU is in its idle loop? If not,
then yes we can insert a call to start_hz_timer only in do_IRQ.

BTW, in the patch that I had sent, I had got the calculation of next_dec
(in stop_hz_timer) wrong. I had considered that tb_last_stamp is ahead of 
jiffies, which is not correct. So the modified code should be something like 
below:



       do {
               seq = read_seqbegin(&xtime_lock);

               delta = next_timer_interrupt() - jiffies;

               if (delta < MIN_SKIP) {
                       cpu_clear(cpu, nohz_cpu_mask);
                       return;
               }

               if (delta > MAX_SKIP)
                       delta = MAX_SKIP;

               next_dec = tb_last_stamp + delta * tb_ticks_per_jiffy;

       } while (read_seqretry(&xtime_lock, seq));

       next_dec -= get_tb();
       set_dec(next_dec);





-- 


Thanks and Regards,
Srivatsa Vaddagiri,
Linux Technology Center,
IBM Software Labs,
Bangalore, INDIA - 560017



More information about the Linuxppc64-dev mailing list