[PATCH] use tsc on 1 cpu smp

From: Pete Wyckoff
Date: Tue Jan 15 2008 - 17:42:28 EST


Use num_online_cpus() instead of num_present_cpus() as the
parameter to check when deciding if TSC is good enough. Thus
explicitly booting with maxcpus=1 will let us use the TSC even on
a dual-processor machine. This helps reduce gettimeofday
overheads on our dual Opteron nodes immensely (30 us vs 0.5 us).

Signed-off-by: Pete Wyckoff <pw@xxxxxxx>
---
arch/x86/kernel/tsc_64.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/x86/kernel/tsc_64.c b/arch/x86/kernel/tsc_64.c
index 9c70af4..5f2e91f 100644
--- a/arch/x86/kernel/tsc_64.c
+++ b/arch/x86/kernel/tsc_64.c
@@ -235,7 +235,7 @@ __cpuinit int unsynchronized_tsc(void)
}

/* Assume multi socket systems are not synchronized */
- return num_present_cpus() > 1;
+ return num_online_cpus() > 1;
}

int __init notsc_setup(char *s)
--
1.5.3.7

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/