Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752865AbXEYHzV (ORCPT ); Fri, 25 May 2007 03:55:21 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1750809AbXEYHzJ (ORCPT ); Fri, 25 May 2007 03:55:09 -0400 Received: from mx2.mail.elte.hu ([157.181.151.9]:35395 "EHLO mx2.mail.elte.hu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750721AbXEYHzI (ORCPT ); Fri, 25 May 2007 03:55:08 -0400 Date: Fri, 25 May 2007 09:54:46 +0200 From: Ingo Molnar To: Andi Kleen Cc: Satyam Sharma , Andrew Morton , linux-kernel@vger.kernel.org, Peter Zijlstra Subject: [patch] x86_64: fix sched_clock() Message-ID: <20070525075446.GA20140@elte.hu> References: <20070525071005.GA6431@elte.hu> <20070525073158.GB8094@one.firstfloor.org> <20070525073957.GA15207@elte.hu> <20070525074316.GA16821@elte.hu> <20070525074915.GA18400@elte.hu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20070525074915.GA18400@elte.hu> User-Agent: Mutt/1.4.2.2i X-ELTE-VirusStatus: clean X-ELTE-SpamScore: -2.0 X-ELTE-SpamLevel: X-ELTE-SpamCheck: no X-ELTE-SpamVersion: ELTE 2.0 X-ELTE-SpamCheck-Details: score=-2.0 required=5.9 tests=BAYES_00 autolearn=no SpamAssassin version=3.1.7 -2.0 BAYES_00 BODY: Bayesian spam probability is 0 to 1% [score: 0.0000] Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2116 Lines: 54 Subject: [patch] x86_64: fix sched_clock() From: Ingo Molnar sched_clock() is totally broken on x86_64, because it is not defined by the architecture at all! It fell the victim to the opaqueness of __attribute__((weak)) and to non-testing. the i386 version was supposed to be used. This patch fixes that. Booted and tested on x86_64 and i386. Signed-off-by: Ingo Molnar --- arch/x86_64/kernel/Makefile | 3 ++- include/asm-x86_64/tsc.h | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) Index: linux-cfs-2.6.22-rc2-mm1.q/arch/x86_64/kernel/Makefile =================================================================== --- linux-cfs-2.6.22-rc2-mm1.q.orig/arch/x86_64/kernel/Makefile +++ linux-cfs-2.6.22-rc2-mm1.q/arch/x86_64/kernel/Makefile @@ -9,7 +9,7 @@ obj-y := process.o signal.o entry.o trap x8664_ksyms.o i387.o syscall.o vsyscall.o \ setup64.o bootflag.o e820.o reboot.o quirks.o i8237.o \ pci-dma.o pci-nommu.o alternative.o hpet.o tsc.o bugs.o \ - perfctr-watchdog.o + perfctr-watchdog.o sched-clock.o obj-$(CONFIG_STACKTRACE) += stacktrace.o obj-$(CONFIG_X86_MCE) += mce.o therm_throt.o @@ -49,6 +49,7 @@ obj-y += pcspeaker.o CFLAGS_vsyscall.o := $(PROFILING) -g0 +sched-clock-y += ../../i386/kernel/sched-clock.o therm_throt-y += ../../i386/kernel/cpu/mcheck/therm_throt.o bootflag-y += ../../i386/kernel/bootflag.o legacy_serial-y += ../../i386/kernel/legacy_serial.o Index: linux-cfs-2.6.22-rc2-mm1.q/include/asm-x86_64/tsc.h =================================================================== --- linux-cfs-2.6.22-rc2-mm1.q.orig/include/asm-x86_64/tsc.h +++ linux-cfs-2.6.22-rc2-mm1.q/include/asm-x86_64/tsc.h @@ -1 +1,6 @@ #include + +/* + * To be able to share sched-clock.c between i386 and x86_64: + */ +#define tsc_disable 0 - 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/