Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753572AbXEYIP2 (ORCPT ); Fri, 25 May 2007 04:15:28 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751351AbXEYIPN (ORCPT ); Fri, 25 May 2007 04:15:13 -0400 Received: from viefep18-int.chello.at ([213.46.255.22]:58890 "EHLO viefep15-int.chello.at" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751159AbXEYIPL (ORCPT ); Fri, 25 May 2007 04:15:11 -0400 Subject: Re: [patch] x86_64: fix sched_clock() From: Peter Zijlstra To: Ingo Molnar Cc: Andi Kleen , Satyam Sharma , Andrew Morton , linux-kernel@vger.kernel.org In-Reply-To: <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> <20070525075446.GA20140@elte.hu> Content-Type: text/plain Date: Fri, 25 May 2007 10:15:06 +0200 Message-Id: <1180080906.7348.35.camel@twins> Mime-Version: 1.0 X-Mailer: Evolution 2.10.1 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2354 Lines: 60 On Fri, 2007-05-25 at 09:54 +0200, Ingo Molnar wrote: > 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 Acked-by: Peter Zijlstra This does indeed solve my issue. > --- > 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/