Re: Patch?: linux-2.5.41 multiprocessor vs. CONFIG_X86_TSC

From: john stultz (johnstul@us.ibm.com)
Date: Thu Oct 10 2002 - 14:01:52 EST


On Thu, 2002-10-10 at 11:22, john stultz wrote:
> Alan has a good cleanup patch (included below) for 2.4. that folks might
> consider to for 2.5. It helps remove the #ifdefs and lets the compiler
> do the optimization.

Whoops, forgot to inline this at the end. This is a bit old, for
2.4.20-pre2, but I don't think much has change here.

diff -Nru a/arch/i386/kernel/setup.c b/arch/i386/kernel/setup.c
--- a/arch/i386/kernel/setup.c Thu Aug 15 17:10:44 2002
+++ b/arch/i386/kernel/setup.c Thu Aug 15 17:10:44 2002
@@ -1145,6 +1145,8 @@
 }
 
 __setup("notsc", tsc_setup);
+#else
+#define tsc_disable 0
 #endif
 
 static int __init highio_setup(char *str)
@@ -2734,10 +2736,8 @@
          */
 
         /* TSC disabled? */
-#ifndef CONFIG_X86_TSC
         if ( tsc_disable )
                 clear_bit(X86_FEATURE_TSC, &c->x86_capability);
-#endif
 
         /* HT disabled? */
         if (disable_x86_ht)
@@ -2979,14 +2979,12 @@
 
         if (cpu_has_vme || cpu_has_tsc || cpu_has_de)
                 clear_in_cr4(X86_CR4_VME|X86_CR4_PVI|X86_CR4_TSD|X86_CR4_DE);
-#ifndef CONFIG_X86_TSC
         if (tsc_disable && cpu_has_tsc) {
                 printk(KERN_NOTICE "Disabling TSC...\n");
                 /**** FIX-HPA: DOES THIS REALLY BELONG HERE? ****/
                 clear_bit(X86_FEATURE_TSC, boot_cpu_data.x86_capability);
                 set_in_cr4(X86_CR4_TSD);
         }
-#endif
 
         __asm__ __volatile__("lgdt %0": "=m" (gdt_descr));
         __asm__ __volatile__("lidt %0": "=m" (idt_descr));

-
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/



This archive was generated by hypermail 2b29 : Tue Oct 15 2002 - 22:00:38 EST