lkml.org 
[lkml]   [2015]   [Apr]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [patch 18/39] tick: sched: Force tick interrupt and get rid of softirq magic
On Wed, Apr 22, 2015 at 04:32:11PM +0200, Thomas Gleixner wrote:
> On Wed, 22 Apr 2015, Frederic Weisbecker wrote:
> > But the reprogramming happens only under "if ((long)delta_jiffies >= 1)".
> > Probably this condition should go away as well.
>
> Errm.
>
> if (!ts->tick_stopped && delta_jiffies <= 1)
> goto out;
>
> So if the tick is NOT stopped and delta_jiffies <= 1 we let it tick
> and do nothing.
>
> if (delta_jiffies >= 1)
> Do the magic nohz stuff
> else
> tick_nohz_restart()
>
> We want the distinction here because if the tick IS stopped and the
> next event is due we need to kick it into gear again. So the condition
> needs to stay. It probably should be if (delta > 1), but that's a
> different story.

Yes but what if the tick is stopped already and delta_jiffies < 1? Say the
tick was last programmed to fire in 5 seconds. An irq fires and enqueues
a timer to fire now. If it's soon enough that delta_jiffies < 1, it seems
we are missing the clock reprogramming and even the softirq from that irq exit.

Because we have:

if (!ts->tick_stopped && delta_jiffies <= 1)
goto out;

if ((long)delta_jiffies >= 1) {
//do clock reprogramming or restart
...
}

- raise_softirq(TIMER_SOFTIRQ);

out:
...

>
> > In the end, the possible side effect, at least on low-res, is that timers
> > which are already expired will be handled on the next tick instead of now.
> > But probably it doesn't matter much to have a one-tick delay.
>
> We really don't care. That stuff has no guarantees aside of the
> guarantee that it does not expire early :)

Good :)

>
> Thanks,
>
> tglx
>


\
 
 \ /
  Last update: 2015-04-23 14:01    [W:0.090 / U:2.752 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site