public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Frederic Weisbecker <fweisbec@gmail.com>
To: Viresh Kumar <viresh.kumar@linaro.org>
Cc: Thomas Gleixner <tglx@linutronix.de>,
	"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	Matthew Whitehead <tedheadster@gmail.com>,
	john.stultz@linaro.org,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	mwhitehe@redhat.com
Subject: Re: nohz problem with idle time on old hardware
Date: Wed, 9 Apr 2014 17:11:15 +0200	[thread overview]
Message-ID: <20140409151108.GA17782@localhost.localdomain> (raw)
In-Reply-To: <CAOh2x=koQ4tXdq5_Bi4Vbo_k1a=zosFA3e4zRJGjzysYmC-PEA@mail.gmail.com>

On Wed, Apr 09, 2014 at 07:21:53PM +0530, Viresh Kumar wrote:
> On Thu, Nov 14, 2013 at 1:31 AM, Thomas Gleixner <tglx@linutronix.de> wrote:
> > Subject: NOHZ: Check for nohz active instead of nohz enabled
> >
> > RCU and the fine grained idle time accounting functions check
> > tick_nohz_enabled. But that variable is merily telling that NOHZ has
> > been enabled in the config and not been disabled on the command line.
> >
> > But it does not tell anything about nohz being active. That's what all
> > this should check for.
> >
> > Matthew reported, that the idle accounting on his old P1 machine
> > showed bogus values, when he enabled NOHZ in the config and did not
> > disable it on the kernel command line. The reason is that his machine
> > uses (refined) jiffies as a clocksource which explains why the "fine"
> > grained accounting went into lala land, because it depends on when the
> > system goes and leaves idle relative to the jiffies increment.
> >
> > Provide a tick_nohz_active indicator and let RCU and the accounting
> > code use this instead of tick_nohz_enable.
> 
> > diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c
> > @@ -973,7 +968,7 @@ static void tick_nohz_switch_to_nohz(void)
> >         struct tick_sched *ts = &__get_cpu_var(tick_cpu_sched);
> >         ktime_t next;
> >
> > -       if (!tick_nohz_enabled)
> > +       if (!tick_nohz_active)
> >                 return;
> 
> Considering the impressive list of Reviewed-by and people involved
> in this patch, I am not sure I am reading the code well here.
> 
> The above change isn't required as per my understanding. Otherwise
> we will never pass that check. tick_nohz_active is initialized as zero
> and so we will keep on returning for ever and wouldn't be able to set
> it to 1 ever.
> 
> I have a patch to fix it up, but wanted to know your opinion before
> sending it.

Ouch, bad thing.

I'm also disovering this whole thread and patch only today, since nobody Cc'ed me :-(
 
> >         local_irq_disable();
> > @@ -981,7 +976,7 @@ static void tick_nohz_switch_to_nohz(void)
> >                 local_irq_enable();
> >                 return;
> >         }
> > -
> > +       tick_nohz_active = 1;
> >         ts->nohz_mode = NOHZ_MODE_LOWRES;
> >
> >         /*
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/

  parent reply	other threads:[~2014-04-09 15:11 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-13 11:39 nohz problem with idle time on old hardware Matthew Whitehead
2013-11-13 14:02 ` Thomas Gleixner
2013-11-13 15:21   ` Steven Rostedt
2013-11-13 15:31     ` Steven Rostedt
2013-11-13 15:50       ` Thomas Gleixner
2013-11-13 16:17         ` Paul E. McKenney
2013-11-13 15:57       ` Steven Rostedt
2013-11-13 16:07         ` Thomas Gleixner
2013-11-13 16:12           ` Steven Rostedt
2013-11-13 16:18             ` Paul E. McKenney
2013-11-13 16:23               ` Steven Rostedt
2013-11-13 16:35                 ` Paul E. McKenney
2013-11-13 20:01                   ` Thomas Gleixner
2013-11-13 20:07                     ` Steven Rostedt
2013-11-13 21:49                       ` Matthew Whitehead
2013-11-18 22:44                     ` Paul E. McKenney
2013-11-19 18:07                     ` [tip:timers/urgent] NOHZ: Check for nohz active instead of nohz enabled tip-bot for Thomas Gleixner
2014-04-09 13:51                     ` nohz problem with idle time on old hardware Viresh Kumar
2014-04-09 14:31                       ` Steven Rostedt
2014-04-09 15:20                         ` Viresh Kumar
2014-04-09 15:29                           ` Steven Rostedt
2014-04-09 15:31                             ` Steven Rostedt
2014-04-09 15:34                               ` Viresh Kumar
2014-04-09 15:39                               ` Steven Rostedt
2014-04-09 15:56                                 ` Viresh Kumar
2014-04-09 16:15                                   ` Steven Rostedt
2014-04-09 15:11                       ` Frederic Weisbecker [this message]
2013-11-13 16:21           ` Thomas Gleixner
2013-11-13 16:31             ` Steven Rostedt

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=20140409151108.GA17782@localhost.localdomain \
    --to=fweisbec@gmail.com \
    --cc=john.stultz@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mwhitehe@redhat.com \
    --cc=paulmck@linux.vnet.ibm.com \
    --cc=rostedt@goodmis.org \
    --cc=tedheadster@gmail.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