Re: [PATCH 03/32 RESEND] nohz: Drop useless ts->inidle check before rearming the tick

Frederic Weisbecker
2011-08-29T16:59:01Z

On Mon, Aug 29, 2011 at 04:23:15PM +0200, Peter Zijlstra wrote:
> On Mon, 2011-08-15 at 17:52 +0200, Frederic Weisbecker wrote:
> > We only need to check if we have ts->stopped to ensure the tick
> > was stopped and we want to re-enable it. Checking ts->inidle
> > there is useless.
>
> /me goes la-la-la-la...
>
> It would so help poor little me who hasn't stared at this code in detail
> for the past several days and is thus horridly confused if you'd expand
> your reasoning somewhat.

Sorry, I'm no big fan of writing changelogs and sometimes the lack
it's unfortunately visible :)$

It needs to be refactored due to the previous patch beeing broken.
But the rationale, indeed missing here, is that if you have ts->stopped
then you have ts->inidle. Once you entered tick_nohz_stop_sched_tick()
you have ts->inidle set and only once you reached that step the tick
can be stopped, so the following check:

if (!ts->inidle || !ts->tick_stopped)

can be summed up with:

if (!ts->tick_stopped) {