From: Andreas Herrmann <andreas.herrmann3@amd.com>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: LKML <linux-kernel@vger.kernel.org>, Ingo Molnar <mingo@elte.hu>,
Arjan van de Veen <arjan@infradead.org>,
"Maciej W. Rozycki" <macro@linux-mips.org>,
Len Brown <lenb@kernel.org>
Subject: [PATCH] x86: emphasize that c1e aware idle stuff is AMD specific
Date: Fri, 4 Jul 2008 17:18:36 +0200 [thread overview]
Message-ID: <20080704151836.GB21102@alberich.amd.com> (raw)
In-Reply-To: <20080704143536.GA21102@alberich.amd.com>
This is to clarify that AMD C1E has nothing to do with Intel's C1E or
C2E.
Furthermore I changed some comment to clarify that currently just AMD
family 0x10 CPUs support MWAIT. AMD family 0x11 has quite similar
power management features like family 0x10 but it has no MONITOR/MWAIT
instructions.
Signed-off-by: Andreas Herrmann <andreas.herrmann3@amd.com>
---
Patch is against current tip/master.
(git describe says: tip-history-2008-06-30_08.08_Mon-441-g7782052
whatever that means ;-)
Regards,
Andreas
arch/x86/kernel/process.c | 36 ++++++++++++++++++------------------
1 files changed, 18 insertions(+), 18 deletions(-)
diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c
index beef5e1..f6da61a 100644
--- a/arch/x86/kernel/process.c
+++ b/arch/x86/kernel/process.c
@@ -189,12 +189,12 @@ static void poll_idle(void)
/*
* mwait selection logic:
*
- * It depends on the CPU. For AMD CPUs that support MWAIT this is
- * wrong. Family 0x10 and 0x11 CPUs will enter C1 on HLT. Powersavings
- * then depend on a clock divisor and current Pstate of the core. If
- * all cores of a processor are in halt state (C1) the processor can
- * enter the C1E (C1 enhanced) state. If mwait is used this will never
- * happen.
+ * It depends on the CPU. For AMD CPUs that support MWAIT - currently
+ * AMD family 0x10 - this is wrong. Those CPUs will enter C1 on
+ * HLT. Powersavings then depend on a clock divisor and current Pstate
+ * of the core. If all cores of a processor are in halt state (C1) the
+ * processor can enter the AMD C1E (C1 enhanced) state. If mwait is
+ * used this will never happen.
*
* idle=mwait overrides this decision and forces the usage of mwait.
*/
@@ -219,16 +219,16 @@ static int __cpuinit mwait_usable(const struct cpuinfo_x86 *c)
return 1;
/*
- * edx enumeratios MONITOR/MWAIT extensions. Check, whether
- * C1 supports MWAIT
+ * EDX enumerates MONITOR/MWAIT extensions. Check, whether an
+ * C1 sub-state is supported using MONITOR/MWAIT.
*/
return (edx & MWAIT_EDX_C1);
}
/*
- * Check for AMD CPUs, which have potentially C1E support
+ * Check for AMD CPUs, which have potentially AMD's C1E support
*/
-static int __cpuinit check_c1e_idle(const struct cpuinfo_x86 *c)
+static int __cpuinit check_amd_c1e_idle(const struct cpuinfo_x86 *c)
{
if (c->x86_vendor != X86_VENDOR_AMD)
return 0;
@@ -236,7 +236,7 @@ static int __cpuinit check_c1e_idle(const struct cpuinfo_x86 *c)
if (c->x86 < 0x0F)
return 0;
- /* Family 0x0f models < rev F do not have C1E */
+ /* Family 0x0f models < rev F do not have AMD C1E */
if (c->x86 == 0x0f && c->x86_model < 0x40)
return 0;
@@ -244,11 +244,11 @@ static int __cpuinit check_c1e_idle(const struct cpuinfo_x86 *c)
}
/*
- * C1E aware idle routine. We check for C1E active in the interrupt
+ * AMD C1E aware idle routine. We check for C1E active in the interrupt
* pending message MSR. If we detect C1E, then we handle it the same
* way as C3 power states (local apic timer and TSC stop)
*/
-static void c1e_idle(void)
+static void amd_c1e_idle(void)
{
static cpumask_t c1e_mask = CPU_MASK_NONE;
static int c1e_detected;
@@ -262,8 +262,8 @@ static void c1e_idle(void)
rdmsr(MSR_K8_INT_PENDING_MSG, lo, hi);
if (lo & K8_INTP_C1E_ACTIVE_MASK) {
c1e_detected = 1;
- mark_tsc_unstable("TSC halt in C1E");
- printk(KERN_INFO "System has C1E enabled\n");
+ mark_tsc_unstable("TSC halts in AMD C1E");
+ printk(KERN_INFO "System has AMD C1E enabled\n");
}
}
@@ -316,9 +316,9 @@ void __cpuinit select_idle_routine(const struct cpuinfo_x86 *c)
*/
printk(KERN_INFO "using mwait in idle threads.\n");
pm_idle = mwait_idle;
- } else if (check_c1e_idle(c)) {
- printk(KERN_INFO "using C1E aware idle routine\n");
- pm_idle = c1e_idle;
+ } else if (check_amd_c1e_idle(c)) {
+ printk(KERN_INFO "using AMD C1E aware idle routine\n");
+ pm_idle = amd_c1e_idle;
} else
pm_idle = default_idle;
}
--
1.5.6.1
next prev parent reply other threads:[~2008-07-04 15:19 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-12 10:28 [patch 0/6] AMD C1E aware idle support Thomas Gleixner
2008-06-12 10:28 ` [patch 1/6] x86: simplify idle selection Thomas Gleixner
2008-06-12 10:28 ` [patch 2/6] x86: cleanup C1E enabled detection Thomas Gleixner
2008-06-12 10:28 ` [patch 3/6] x86: use cpuinfo to check for interrupt pending message msr Thomas Gleixner
2008-06-13 6:55 ` Andreas Herrmann
2008-06-13 12:38 ` Thomas Gleixner
2008-06-13 14:28 ` Andreas Herrmann
2008-06-12 10:28 ` [patch 4/6] x86: use cpuid to check MWAIT support for C1 Thomas Gleixner
2008-06-12 10:28 ` [patch 5/6] x86: move more common idle functions/variables to process.c Thomas Gleixner
2008-06-12 10:29 ` [patch 6/6] x86: add c1e aware idle function Thomas Gleixner
2008-06-13 0:55 ` Andrew Morton
2008-06-13 6:02 ` Thomas Gleixner
2008-06-13 7:28 ` Andrew Morton
2008-06-18 19:21 ` Pavel Machek
2008-06-18 20:26 ` Rafael J. Wysocki
2008-06-18 21:58 ` Thomas Gleixner
2008-06-18 22:04 ` Rafael J. Wysocki
2008-06-18 22:17 ` Thomas Gleixner
2008-06-18 22:27 ` Rafael J. Wysocki
2008-06-12 12:31 ` [patch 0/6] AMD C1E aware idle support Rafael J. Wysocki
2008-06-12 12:32 ` Ingo Molnar
[not found] ` <200806131118.31160.rjw@sisk.pl>
2008-06-13 11:52 ` Rafael J. Wysocki
2008-06-12 13:09 ` Thomas Gleixner
2008-06-12 14:24 ` Andreas Herrmann
2008-06-12 15:48 ` Thomas Gleixner
2008-06-14 21:27 ` Maciej W. Rozycki
2008-06-18 22:47 ` Len Brown
2008-07-04 14:35 ` Andreas Herrmann
2008-07-04 15:18 ` Andreas Herrmann [this message]
2008-08-05 17:42 ` Pavel Machek
2008-08-06 13:21 ` Andreas Herrmann
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=20080704151836.GB21102@alberich.amd.com \
--to=andreas.herrmann3@amd.com \
--cc=arjan@infradead.org \
--cc=lenb@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=macro@linux-mips.org \
--cc=mingo@elte.hu \
--cc=tglx@linutronix.de \
/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