mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Eero Nurkkala <ext-eero.nurkkala@nokia.com>
To: ext Steven Noonan <steven@uplinklabs.net>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Rik van Riel <riel@redhat.com>,
	Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>,
	Greg KH <greg@kroah.com>, Ingo Molnar <mingo@elte.hu>
Subject: Re: [BISECTED] "conservative" cpufreq governor broken
Date: Wed, 07 Oct 2009 12:31:41 +0300	[thread overview]
Message-ID: <1254907901.30157.93.camel@eenurkka-desktop> (raw)
In-Reply-To: <f488382f0910070152y1c09602by444fd9466912bbb5@mail.gmail.com>

On Wed, 2009-10-07 at 10:52 +0200, ext Steven Noonan wrote:
> On Wed, Oct 7, 2009 at 1:43 AM, Eero Nurkkala
> <ext-eero.nurkkala@nokia.com> wrote:
> > On Wed, 2009-10-07 at 10:24 +0200, ext Steven Noonan wrote:
> >> >
> >> > Steven, how do the cpu loads look like without the patch?
> >>
> >> They're sane:
> >>
> >> [   40.019381] cpufreq load = 100 * (66666 - 66337) / 66666 = 0
> >> [   40.019396] cpufreq load = 100 * (66666 - 66299) / 66666 = 0
> >> [   73.352580] cpufreq load = 100 * (66717 - 66349) / 66717 = 0
> >> [   73.352595] cpufreq load = 100 * (66634 - 63848) / 66634 = 4
> >
> > Thank you. Could you please try the following:
> > Now, if ts->nohz_mode == NOHZ_MODE_INACTIVE, ts->inidle is not set
> > and all subsequent calls from irq_exit() think we weren't idling,
> > which is not true.
> >
> > --- a/kernel/time/tick-sched.c
> > +++ b/kernel/time/tick-sched.c
> > @@ -233,6 +233,8 @@ void tick_nohz_stop_sched_tick(int inidle)
> >
> >        now = tick_nohz_start_idle(ts);
> >
> > +       ts->inidle = 1;
> > +
> >        /*
> >         * If this cpu is offline and it is the one which updates
> >         * jiffies, then give up the assignment and let it be taken by
> > @@ -248,8 +250,6 @@ void tick_nohz_stop_sched_tick(int inidle)
> >        if (unlikely(ts->nohz_mode == NOHZ_MODE_INACTIVE))
> >                goto end;
> >
> > -       ts->inidle = 1;
> > -
> >        if (need_resched())
> >                goto end;
> >
> 
> Yeah, that fixed it. The load is now sane, my system isn't heating up,
> and 'conservative' is now clocking my CPU down to the minimum as is
> appropriate.
> 

For some reason, this path is taken: 
if (ts->nohz_mode == NOHZ_MODE_INACTIVE)
        goto end;

> Can you explain why this only affected 'conservative', why it caused
> my machine to heat up, etc?
> 
Maybe the loads dont look good with ondemand either? if you trace them
out. Below is a patch that has explanation on what's happening in
your system.

> Also, this fix should probably be passed on to Greg K. H. (so it goes
> in 2.6.31-stable) as well as Ingo Molnar (so it goes into -tip, and
> hopefully to Linus for 2.6.32). Both CC'd.
> 
> - Steven

From: Eero Nurkkala <ext-eero.nurkkala@nokia.com>
Date: Wed, 7 Oct 2009 11:54:26 +0300
Subject: [PATCH] NOHZ: update idle state properly

Commit f2e21c9610991e95621a81407cdbab881226419b
had unfortunate side effects with cpufreq governors on
some systems.

If NOHZ_MODE_INACTIVE was set, ts->inidle was not being
set. Then, all subsequent calls from irq_exit() bypassed
calls to tick_nohz_start_idle() which resulted in wrong
information passed to cpufreq governors. Fix this by
updating the state of ts->inidle where it fits the best.

Reported-by: Steven Noonan <steven@uplinklabs.net>
Signed-off-by: Eero Nurkkala <ext-eero.nurkkala@nokia.com>
---
 kernel/time/tick-sched.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c
index e0f59a2..4c1b0ac 100644
--- a/kernel/time/tick-sched.c
+++ b/kernel/time/tick-sched.c
@@ -233,6 +233,8 @@ void tick_nohz_stop_sched_tick(int inidle)
 
 	now = tick_nohz_start_idle(ts);
 
+	ts->inidle = 1;
+
 	/*
 	 * If this cpu is offline and it is the one which updates
 	 * jiffies, then give up the assignment and let it be taken by
@@ -248,8 +250,6 @@ void tick_nohz_stop_sched_tick(int inidle)
 	if (unlikely(ts->nohz_mode == NOHZ_MODE_INACTIVE))
 		goto end;
 
-	ts->inidle = 1;
-
 	if (need_resched())
 		goto end;
 
-- 
1.6.0.4



  reply	other threads:[~2009-10-07  9:34 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-05 16:32 Steven Noonan
2009-10-06  7:31 ` Eero Nurkkala
2009-10-06 10:22   ` Steven Noonan
2009-10-06 10:43     ` Eero Nurkkala
2009-10-06 11:22       ` Steven Noonan
2009-10-06 12:36         ` Eero Nurkkala
2009-10-07  0:54           ` Steven Noonan
2009-10-07  1:22             ` Steven Noonan
2009-10-07  5:27               ` Eero Nurkkala
2009-10-07  7:30                 ` Steven Noonan
2009-10-07  7:49                   ` Eero Nurkkala
2009-10-07  8:05                     ` Steven Noonan
2009-10-07  8:11                       ` Steven Noonan
2009-10-07  8:14                       ` Eero Nurkkala
2009-10-07  8:24                         ` Steven Noonan
2009-10-07  8:43                           ` Eero Nurkkala
2009-10-07  8:52                             ` Steven Noonan
2009-10-07  9:31                               ` Eero Nurkkala [this message]
2009-10-07 10:42                                 ` Thomas Gleixner
2009-10-07 11:03                                   ` Steven Noonan
2009-10-07 11:15                                     ` Thomas Gleixner
2009-10-07 11:06                                 ` [tip:timers/urgent] NOHZ: update idle state also when NOHZ is inactive tip-bot for Eero Nurkkala
2009-10-07 13:35                                   ` Rik van Riel

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=1254907901.30157.93.camel@eenurkka-desktop \
    --to=ext-eero.nurkkala@nokia.com \
    --cc=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=riel@redhat.com \
    --cc=steven@uplinklabs.net \
    --cc=tglx@linutronix.de \
    --cc=venkatesh.pallipadi@intel.com \
    /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

all inboxes | Powered by JetHome®