On Thu, Jul 03, 2014 at 11:12:52AM +0530, Viresh Kumar wrote:
When expiry is set to KTIME_MAX, we cancel the 'tick-sched' hrtimer in highres mode and skip reprogramming clockevent device in lowres mode. But, the clockevent device is already reprogrammed from tick-handler.
We will surely get interrupted atleast one more time at tick-interval.
In highres mode, as there is no tick-sched hrtimer to service, we wouldn't restart the tick.
But in lowres mode, we unconditionally reschedule the tick every time tick_nohz_handler() is called. So, even if 'tick_stopped' is set to '1', we will never be in full dynticks mode.
To fix this, lets skip rescheduling next tick from tick-handler when we are running tickless.
So the patch looks good but I wonder if the changelog is a bit misleading. It fixes the fact that in lowres mode, the tick is rescheduled at every tick.
But after this patch, don't we still have at one remaining spurious tick in this scenario:
tick_nohz_handler() { reprogram next tick }
irq_exit() { tick_nohz_stop_sched_tick() { expires = KTIME_MAX; //skip reprogramming, but still have a pending tick } }
//useless tick tick_nohz_handle()
We probably also need a cancel for low-res mode as well.