From: john stultz <johnstul@us.ibm.com>
To: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [RFC] [PATCH] Disable TSCs on CONFIG_MULTIQUAD
Date: 30 May 2002 11:50:15 -0700 [thread overview]
Message-ID: <1022784616.1963.106.camel@cog> (raw)
In-Reply-To: <1022712736.9255.289.camel@irongate.swansea.linux.org.uk>
[-- Attachment #1: Type: text/plain, Size: 279 bytes --]
> Add CONFIG_X86_TSC_NOT_SYNCHRONOUS or similar and then check
>
> #if defined(CONFIG_X86_TSC) && !defined(CONFIG_X86_NOT_SYNCHRONOUS))
Attached is the patch implemented as suggested above. It seems a bit
uglier, but perhaps I'm missing exactly what you meant.
thanks
-john
[-- Attachment #2: tsc-disable_A4.patch --]
[-- Type: text/plain, Size: 4870 bytes --]
Index: linux24/arch/i386/config.in
diff -u linux24/arch/i386/config.in:1.1.1.3 linux24/arch/i386/config.in:1.1.1.3.14.4
--- linux24/arch/i386/config.in:1.1.1.3 Wed Feb 13 14:53:47 2002
+++ linux24/arch/i386/config.in Thu May 30 11:28:18 2002
@@ -198,6 +198,11 @@
bool 'Multiquad NUMA system' CONFIG_MULTIQUAD
fi
+# Multiquad NUMA boxes can't keep their TSCs in sync
+if [ "$CONFIG_MULTIQUAD" = "y" ]; then
+ define_bool CONFIG_TSC_DISABLE y
+fi
+
if [ "$CONFIG_SMP" = "y" -a "$CONFIG_X86_CMPXCHG" = "y" ]; then
define_bool CONFIG_HAVE_DEC_LOCK y
fi
Index: linux24/arch/i386/kernel/setup.c
diff -u linux24/arch/i386/kernel/setup.c:1.1.1.3.14.1 linux24/arch/i386/kernel/setup.c:1.1.1.3.14.6
--- linux24/arch/i386/kernel/setup.c:1.1.1.3.14.1 Tue May 28 17:30:29 2002
+++ linux24/arch/i386/kernel/setup.c Thu May 30 11:28:18 2002
@@ -1053,8 +1053,12 @@
__setup("cachesize=", cachesize_setup);
-#ifndef CONFIG_X86_TSC
+#if !defined(CONFIG_X86_TSC)||defined(CONFIG_TSC_DISABLE)
+#ifdef CONFIG_TSC_DISABLE
+static int tsc_disable __initdata = 1;
+#else /*CONFIG_TSC_DISABLE*/
static int tsc_disable __initdata = 0;
+#endif /*CONFIG_TSC_DISABLE*/
static int __init tsc_setup(char *str)
{
@@ -2650,7 +2654,7 @@
*/
/* TSC disabled? */
-#ifndef CONFIG_X86_TSC
+#if !defined(CONFIG_X86_TSC)||defined(CONFIG_TSC_DISABLE)
if ( tsc_disable )
clear_bit(X86_FEATURE_TSC, &c->x86_capability);
#endif
@@ -2888,7 +2892,7 @@
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 !defined(CONFIG_X86_TSC)||defined(CONFIG_TSC_DISABLE)
if (tsc_disable && cpu_has_tsc) {
printk(KERN_NOTICE "Disabling TSC...\n");
/**** FIX-HPA: DOES THIS REALLY BELONG HERE? ****/
Index: linux24/arch/i386/kernel/time.c
diff -u linux24/arch/i386/kernel/time.c:1.1.1.2 linux24/arch/i386/kernel/time.c:1.1.1.2.14.2
--- linux24/arch/i386/kernel/time.c:1.1.1.2 Wed Feb 13 14:53:48 2002
+++ linux24/arch/i386/kernel/time.c Thu May 30 11:28:18 2002
@@ -118,7 +118,7 @@
extern spinlock_t i8259A_lock;
-#ifndef CONFIG_X86_TSC
+#if !defined(CONFIG_X86_TSC)||defined(CONFIG_TSC_DISABLE)
/* This function must be called with interrupts disabled
* It was inspired by Steve McCanne's microtime-i386 for BSD. -- jrs
Index: linux24/include/asm-i386/bugs.h
diff -u linux24/include/asm-i386/bugs.h:1.1.1.1 linux24/include/asm-i386/bugs.h:1.1.1.1.40.2
--- linux24/include/asm-i386/bugs.h:1.1.1.1 Tue Dec 18 15:49:01 2001
+++ linux24/include/asm-i386/bugs.h Thu May 30 11:28:18 2002
@@ -173,7 +173,7 @@
/*
* If we configured ourselves for a TSC, we'd better have one!
*/
-#ifdef CONFIG_X86_TSC
+#if defined(CONFIG_X86_TSC)&&!defined(CONFIG_TSC_DISABLE)
if (!cpu_has_tsc)
panic("Kernel compiled for Pentium+, requires TSC feature!");
#endif
Index: linux24/include/asm-i386/timex.h
diff -u linux24/include/asm-i386/timex.h:1.1.1.2 linux24/include/asm-i386/timex.h:1.1.1.2.14.2
--- linux24/include/asm-i386/timex.h:1.1.1.2 Wed Feb 13 14:52:42 2002
+++ linux24/include/asm-i386/timex.h Thu May 30 11:28:18 2002
@@ -40,7 +40,7 @@
static inline cycles_t get_cycles (void)
{
-#ifndef CONFIG_X86_TSC
+#if !defined(CONFIG_X86_TSC) || defined(CONFIG_TSC_DISABLE)
return 0;
#else
unsigned long long ret;
Index: linux24/include/net/pkt_sched.h
diff -u linux24/include/net/pkt_sched.h:1.1.1.1 linux24/include/net/pkt_sched.h:1.1.1.1.40.2
--- linux24/include/net/pkt_sched.h:1.1.1.1 Tue Dec 18 15:49:02 2001
+++ linux24/include/net/pkt_sched.h Thu May 30 11:28:18 2002
@@ -11,7 +11,7 @@
#include <linux/pkt_sched.h>
#include <net/pkt_cls.h>
-#ifdef CONFIG_X86_TSC
+#if defined(CONFIG_X86_TSC)&&!defined(CONFIG_TSC_DISABLE)
#include <asm/msr.h>
#endif
@@ -252,7 +252,7 @@
#define PSCHED_US2JIFFIE(delay) (((delay)+psched_clock_per_hz-1)/psched_clock_per_hz)
-#ifdef CONFIG_X86_TSC
+#if defined(CONFIG_X86_TSC)&&!defined(CONFIG_TSC_DISABLE)
#define PSCHED_GET_TIME(stamp) \
({ u64 __cur; \
Index: linux24/include/net/profile.h
diff -u linux24/include/net/profile.h:1.1.1.1 linux24/include/net/profile.h:1.1.1.1.40.2
--- linux24/include/net/profile.h:1.1.1.1 Tue Dec 18 15:49:02 2001
+++ linux24/include/net/profile.h Thu May 30 11:28:18 2002
@@ -9,7 +9,7 @@
#include <linux/kernel.h>
#include <asm/system.h>
-#ifdef CONFIG_X86_TSC
+#if defined(CONFIG_X86_TSC) && !defined(CONFIG_TSC_DISABLE)
#include <asm/msr.h>
#endif
@@ -29,7 +29,7 @@
extern struct timeval net_profile_adjust;
extern void net_profile_irq_adjust(struct timeval *entered, struct timeval* leaved);
-#ifdef CONFIG_X86_TSC
+#if defined(CONFIG_X86_TSC)&&!defined(CONFIG_TSC_DISABLE)
static inline void net_profile_stamp(struct timeval *pstamp)
{
prev parent reply other threads:[~2002-05-30 18:53 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-05-29 20:40 [RFC] [PATCH] Disable TSCs on CONFIG_MULTIQUAD john stultz
2002-05-29 22:52 ` Alan Cox
2002-05-30 0:20 ` john stultz
2002-05-30 1:37 ` Alan Cox
2002-05-30 0:54 ` Martin J. Bligh
2002-05-30 1:36 ` john stultz
2002-05-30 18:50 ` john stultz [this message]
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=1022784616.1963.106.camel@cog \
--to=johnstul@us.ibm.com \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=linux-kernel@vger.kernel.org \
/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