All of lore.kernel.org
 help / color / mirror / Atom feed
From: Seth Forshee <seth.forshee@canonical.com>
To: Thomas Gleixner <tglx@linutronix.de>, Len Brown <lenb@kernel.org>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	"H. Peter Anvin" <hpa@zytor.com>,
	Arjan van de Ven <arjan@infradead.org>,
	Venkatesh Pallipadi <venki@google.com>
Subject: Re: Performance/resume issues on Toshiba NB305
Date: Tue, 1 Mar 2011 14:04:46 -0600	[thread overview]
Message-ID: <20110301200446.GA2235@thinkpad-t410> (raw)
In-Reply-To: <alpine.LFD.2.00.1102252231200.2701@localhost6.localdomain6>

On Fri, Feb 25, 2011 at 10:47:16PM +0100, Thomas Gleixner wrote:
> On Fri, 25 Feb 2011, Seth Forshee wrote:
> > On Fri, Feb 25, 2011 at 09:37:39PM +0100, Thomas Gleixner wrote:
> > > On Fri, 25 Feb 2011, Seth Forshee wrote:
> > > That seems to be related to low power states. When the machine goes
> > > idle we switch into lower power states and that requires to use the
> > > hpet instead of the local apic timer as that one stops.
> > > 
> > > You could verify that theory by booting with processor.max_cstate=1
> > 
> > This fixes the performance in combination with intel_idle.max_cstate=0.
> > Alternately, intel_idle.max_cstate=1 works. But the resume still hangs.
> 
> That was expected :)
> 
> > Is the answer to quirk the machine to avoid deep C-states, or is there
> > some better way I can fix this?
> 
> Let's wait for the intel and acpi folks. It would be interesting what
> the new intel toy says to your BIOS.

Since the discussion on this issue died without really getting anywhere,
I went ahead and threw together the patch below to disable anything
deeper than C1 for this machine. I hope a better solution can be found,
but if not would something like this be an acceptable workaround?

As for the hangs during resume, unless someone has a better suggestion I
guess I'll start looking into forcing the HPET to remain in periodic
mode throughout suspend.

Thanks,
Seth

---

diff --git a/drivers/idle/intel_idle.c b/drivers/idle/intel_idle.c
index 1fa091e..7d88540 100644
--- a/drivers/idle/intel_idle.c
+++ b/drivers/idle/intel_idle.c
@@ -61,6 +61,7 @@
 #include <linux/sched.h>
 #include <linux/notifier.h>
 #include <linux/cpu.h>
+#include <linux/dmi.h>
 #include <asm/mwait.h>
 
 #define INTEL_IDLE_VERSION "0.4"
@@ -441,6 +442,32 @@ static int intel_idle_cpuidle_devices_init(void)
 }
 
 
+/*
+ * dmi_disable_cstates()
+ * Disable states beyond C1 for broken machines
+ */
+static int __init dmi_disable_cstates(const struct dmi_system_id *d)
+{
+	if (max_cstate == MWAIT_MAX_NUM_CSTATES - 1) {
+		pr_notice(PREFIX "%s detected, disabling C-states past C1\n",
+			  d->ident);
+		max_cstate = 1;
+	}
+}
+
+/* List of systems with known idle problems */
+static struct dmi_system_id __initdata bad_cstate_dmi_table[] = {
+	{
+		.callback	= dmi_disable_cstates,
+		.ident		= "Toshiba NB305",
+		.matches	= {
+			DMI_MATCH(DMI_BOARD_VENDOR, "TOSHIBA"),
+			DMI_MATCH(DMI_BOARD_NAME, "NPVAA"),
+		},
+	},
+	{}
+};
+
 static int __init intel_idle_init(void)
 {
 	int retval;
@@ -449,6 +476,9 @@ static int __init intel_idle_init(void)
 	if (boot_option_idle_override != IDLE_NO_OVERRIDE)
 		return -ENODEV;
 
+	/* Check for known-bad hardware */
+	dmi_check_system(bad_cstate_dmi_table);
+
 	retval = intel_idle_probe();
 	if (retval)
 		return retval;
-- 
1.7.4.1


  parent reply	other threads:[~2011-03-01 20:04 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-25 16:42 Performance/resume issues on Toshiba NB305 Seth Forshee
2011-02-25 20:17 ` Steven Rostedt
2011-02-25 20:27   ` Seth Forshee
2011-02-25 22:11     ` Thomas Gleixner
2011-02-25 22:33       ` Seth Forshee
2011-02-25 20:37 ` Thomas Gleixner
2011-02-25 21:21   ` Seth Forshee
2011-02-25 21:47     ` Thomas Gleixner
2011-02-25 22:29       ` Seth Forshee
2011-02-25 22:40         ` Thomas Gleixner
2011-02-26  5:58           ` Burt Triplett
2011-02-26 15:00             ` Seth Forshee
2011-02-27 20:17               ` Burt Triplett
2011-02-28 15:10                 ` Seth Forshee
2011-03-05  5:55                   ` Burt Triplett
2011-02-26  8:49       ` [tip:timers/urgent] clockevents: Prevent oneshot mode when broadcast device is periodic tip-bot for Thomas Gleixner
2011-03-01 20:04       ` Seth Forshee [this message]
2011-03-01 20:22         ` Performance/resume issues on Toshiba NB305 Thomas Gleixner

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=20110301200446.GA2235@thinkpad-t410 \
    --to=seth.forshee@canonical.com \
    --cc=arjan@infradead.org \
    --cc=hpa@zytor.com \
    --cc=lenb@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tglx@linutronix.de \
    --cc=venki@google.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.