Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=27415a4fe369e07a1393ae52c8ed8e48aabed5a9
Commit:     27415a4fe369e07a1393ae52c8ed8e48aabed5a9
Parent:     2274c33ebdfbb848e7291849e662d36519b52bf4
Author:     Hiroshi Shimamoto <[EMAIL PROTECTED]>
AuthorDate: Wed Jan 30 13:33:18 2008 +0100
Committer:  Ingo Molnar <[EMAIL PROTECTED]>
CommitDate: Wed Jan 30 13:33:18 2008 +0100

    x86: move warning message of polling idle and HT enabled
    
    The warning message at idle_setup() is never shown because
    smp_num_sibling hasn't been updated at this point yet.
    
    Move this polling idle and HT enabled warning to select_idle_routine().
    I also implement this warning on 64-bit kernel.
    
    Signed-off-by: Hiroshi Shimamoto <[EMAIL PROTECTED]>
    Signed-off-by: Ingo Molnar <[EMAIL PROTECTED]>
    Signed-off-by: Thomas Gleixner <[EMAIL PROTECTED]>
---
 arch/x86/kernel/process_32.c |   18 ++++++++++++------
 arch/x86/kernel/process_64.c |   17 ++++++++++++-----
 2 files changed, 24 insertions(+), 11 deletions(-)

diff --git a/arch/x86/kernel/process_32.c b/arch/x86/kernel/process_32.c
index 9f45a51..b72d7d1 100644
--- a/arch/x86/kernel/process_32.c
+++ b/arch/x86/kernel/process_32.c
@@ -295,17 +295,27 @@ static int mwait_usable(const struct cpuinfo_x86 *c)
 
 void __cpuinit select_idle_routine(const struct cpuinfo_x86 *c)
 {
+       static int selected;
+
+       if (selected)
+               return;
+#ifdef CONFIG_X86_SMP
+       if (pm_idle == poll_idle && smp_num_siblings > 1) {
+               printk(KERN_WARNING "WARNING: polling idle and HT enabled,"
+                       " performance may degrade.\n");
+       }
+#endif
        if (cpu_has(c, X86_FEATURE_MWAIT) && mwait_usable(c)) {
-               printk("monitor/mwait feature present.\n");
                /*
                 * Skip, if setup has overridden idle.
                 * One CPU supports mwait => All CPUs supports mwait
                 */
                if (!pm_idle) {
-                       printk("using mwait in idle threads.\n");
+                       printk(KERN_INFO "using mwait in idle threads.\n");
                        pm_idle = mwait_idle;
                }
        }
+       selected = 1;
 }
 
 static int __init idle_setup(char *str)
@@ -313,10 +323,6 @@ static int __init idle_setup(char *str)
        if (!strcmp(str, "poll")) {
                printk("using polling idle threads.\n");
                pm_idle = poll_idle;
-#ifdef CONFIG_X86_SMP
-               if (smp_num_siblings > 1)
-                       printk("WARNING: polling idle and HT enabled, 
performance may degrade.\n");
-#endif
        } else if (!strcmp(str, "mwait"))
                force_mwait = 1;
        else
diff --git a/arch/x86/kernel/process_64.c b/arch/x86/kernel/process_64.c
index dbe0a84..9531353 100644
--- a/arch/x86/kernel/process_64.c
+++ b/arch/x86/kernel/process_64.c
@@ -291,20 +291,27 @@ static int mwait_usable(const struct cpuinfo_x86 *c)
 
 void __cpuinit select_idle_routine(const struct cpuinfo_x86 *c)
 {
-       static int printed;
+       static int selected;
+
+       if (selected)
+               return;
+#ifdef CONFIG_X86_SMP
+       if (pm_idle == poll_idle && smp_num_siblings > 1) {
+               printk(KERN_WARNING "WARNING: polling idle and HT enabled,"
+                       " performance may degrade.\n");
+       }
+#endif
        if (cpu_has(c, X86_FEATURE_MWAIT) && mwait_usable(c)) {
                /*
                 * Skip, if setup has overridden idle.
                 * One CPU supports mwait => All CPUs supports mwait
                 */
                if (!pm_idle) {
-                       if (!printed) {
-                               printk(KERN_INFO "using mwait in idle 
threads.\n");
-                               printed = 1;
-                       }
+                       printk(KERN_INFO "using mwait in idle threads.\n");
                        pm_idle = mwait_idle;
                }
        }
+       selected = 1;
 }
 
 static int __init idle_setup(char *str)
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to