From: Frederic Weisbecker <fweisbec@gmail.com>
To: Preeti U Murthy <preeti@linux.vnet.ibm.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
Peter Zijlstra <peterz@infradead.org>,
Thomas Gleixner <tglx@linutronix.de>,
Christoph Lameter <cl@linux.com>, Ingo Molnar <mingo@kernel.org>,
Viresh Kumar <viresh.kumar@linaro.org>,
Rik van Riel <riel@redhat.com>
Subject: Re: [PATCH 4/8] nohz: Remove idle task special case
Date: Tue, 7 Jul 2015 16:45:59 +0200 [thread overview]
Message-ID: <20150707144557.GF20498@lerouge> (raw)
In-Reply-To: <557CDC82.9080903@linux.vnet.ibm.com>
On Sun, Jun 14, 2015 at 07:14:34AM +0530, Preeti U Murthy wrote:
> On 06/11/2015 11:06 PM, Frederic Weisbecker wrote:
> > This is a leftover from old days to avoid conflicts with dynticks idle
> > code. Now full dynticks and idle dynticks are better integrated and
> > interact without known issue.
>
> I am sorry but I fail to understand why the check on idle task was there
> in the first place in the below code paths. It would help if you could
> clarify this in the changelog as well.
Because dynticks-idle maintains various stats that were ignored by nohz
full. Both machinery were so badly integrated to each other that if the
nohz full code started or stopped the tick in idle on behalf of the dynticks
idle code, the relevant stats got ignored or buggy. But now the code has
been consolidated to handle that.
I'll try to improve the changelog.
>
> >
> > So lets remove it.
> >
> > Cc: Christoph Lameter <cl@linux.com>
> > Cc: Ingo Molnar <mingo@kernel.org>
> > Cc; John Stultz <john.stultz@linaro.org>
> > Cc: Peter Zijlstra <peterz@infradead.org>
> > Cc: Preeti U Murthy <preeti@linux.vnet.ibm.com>
> > Cc: Rik van Riel <riel@redhat.com>
> > Cc: Thomas Gleixner <tglx@linutronix.de>
> > Cc: Viresh Kumar <viresh.kumar@linaro.org>
> > Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
> > ---
> > kernel/time/tick-sched.c | 8 +++-----
> > 1 file changed, 3 insertions(+), 5 deletions(-)
> >
> > diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c
> > index 812f7a3..324482f 100644
> > --- a/kernel/time/tick-sched.c
> > +++ b/kernel/time/tick-sched.c
> > @@ -208,10 +208,8 @@ void __tick_nohz_full_check(void)
> > struct tick_sched *ts = this_cpu_ptr(&tick_cpu_sched);
> >
> > if (tick_nohz_full_cpu(smp_processor_id())) {
> > - if (ts->tick_stopped && !is_idle_task(current)) {
> > - if (!can_stop_full_tick())
>
> can_stop_full_tick() would have bailed out if the current task was idle,
> since it checks for the number of tasks being greater than 1 to restart
> the tick. So why was the check is_idle_task() introduced earlier ?
If the tick was stopped by dynticks idle and we received that IPI before
the tick got a chance to be restarted by the dynticks-idle code, the tick
could be restarted by nohz full and break some idle related statistics.
So we had to introduce that condition before the code got consolidated.
>
> > - tick_nohz_restart_sched_tick(ts, ktime_get());
> > - }
> > + if (ts->tick_stopped && !can_stop_full_tick())
> > + tick_nohz_restart_sched_tick(ts, ktime_get());
> > }
> > }
> >
> > @@ -710,7 +708,7 @@ static void tick_nohz_full_stop_tick(struct tick_sched *ts)
> > #ifdef CONFIG_NO_HZ_FULL
> > int cpu = smp_processor_id();
> >
> > - if (!tick_nohz_full_cpu(cpu) || is_idle_task(current))
> > + if (!tick_nohz_full_cpu(cpu))
>
> If the current task was indeed idle, the check on ts->inidle would have
> succeeded in tick_irq_exit() and we would not have reached this function
> at all, isn't it? So here too I am unable to understand why we had it in
> the first place.
is_idle_task() means that we run the idle task. But ts->inidle means that we
run the idle task between tick_nohz_idle_enter() and tick_nohz_idle_exit().
So there was a chance that we stopped the tick with full dynticks and then
tick_nohz_idle_enter() gets called with tick disabled and break some stats
in the way.
Again that's all leftover junk from early code.
> Regards
> Preeti U Murthy
> > return;
> >
> > if (!ts->tick_stopped && ts->nohz_mode == NOHZ_MODE_INACTIVE)
> >
>
next prev parent reply other threads:[~2015-07-07 14:46 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-11 17:36 [PATCH 0/8] tick/nohz: Tick dependency quick check + cleanups Frederic Weisbecker
2015-06-11 17:36 ` [PATCH 1/8] jiffies: Remove HZ > USEC_PER_SEC special case Frederic Weisbecker
2015-06-11 20:46 ` Rik van Riel
2015-06-11 17:36 ` [PATCH 2/8] apm32: Fix cputime == jiffies assumption Frederic Weisbecker
2015-06-11 20:47 ` Rik van Riel
2015-06-11 17:36 ` [PATCH 3/8] alpha: Fix jiffies based cputime assumption Frederic Weisbecker
2015-06-11 20:47 ` Rik van Riel
2015-06-11 17:36 ` [PATCH 4/8] nohz: Remove idle task special case Frederic Weisbecker
2015-06-11 20:47 ` Rik van Riel
2015-06-14 1:44 ` Preeti U Murthy
2015-07-07 14:45 ` Frederic Weisbecker [this message]
2015-06-11 17:36 ` [PATCH 5/8] nohz: Restart the tick from irq exit Frederic Weisbecker
2015-06-11 20:48 ` Rik van Riel
2015-06-12 7:32 ` Peter Zijlstra
2015-06-12 12:38 ` Frederic Weisbecker
2015-06-12 12:59 ` Peter Zijlstra
2015-06-12 13:06 ` Frederic Weisbecker
2015-06-14 9:30 ` Preeti U Murthy
2015-07-07 14:23 ` Frederic Weisbecker
2015-06-14 9:18 ` Preeti U Murthy
2015-06-14 9:19 ` Preeti U Murthy
2015-07-07 14:20 ` Frederic Weisbecker
2015-06-11 17:36 ` [PATCH 6/8] nohz: Move tick_nohz_restart_sched_tick() above its users Frederic Weisbecker
2015-06-11 20:48 ` Rik van Riel
2015-06-11 17:36 ` [PATCH 7/8] nohz: Evaluate tick dependency once on context switch Frederic Weisbecker
2015-06-11 20:46 ` Rik van Riel
2015-06-17 5:59 ` Preeti U Murthy
2015-07-07 14:30 ` Frederic Weisbecker
2015-06-12 7:36 ` Peter Zijlstra
2015-07-06 16:14 ` Frederic Weisbecker
2015-06-11 17:36 ` [PATCH 8/8] nohz: Remove useless argument on tick_nohz_task_switch() Frederic Weisbecker
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150707144557.GF20498@lerouge \
--to=fweisbec@gmail.com \
--cc=cl@linux.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
--cc=preeti@linux.vnet.ibm.com \
--cc=riel@redhat.com \
--cc=tglx@linutronix.de \
--cc=viresh.kumar@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox