Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758189AbYFIRz2 (ORCPT ); Mon, 9 Jun 2008 13:55:28 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753620AbYFIRzU (ORCPT ); Mon, 9 Jun 2008 13:55:20 -0400 Received: from smtp-outbound-1.vmware.com ([65.113.40.141]:43547 "EHLO smtp-outbound-1.vmware.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753475AbYFIRzU (ORCPT ); Mon, 9 Jun 2008 13:55:20 -0400 Subject: Re: [RFC PATCH] x86:Use cpu_khz for loops_per_jiffy calculation From: Alok Kataria Reply-To: akataria@vmware.com To: Ingo Molnar Cc: Thomas Gleixner , LKML , Daniel Hecht , Tim Mann , Zach Amsden , Sahil Rihan In-Reply-To: <20080609131136.GA27588@elte.hu> References: <1212540069.19290.57.camel@promb-2n-dhcp368.eng.vmware.com> <20080609131136.GA27588@elte.hu> Content-Type: text/plain Organization: VMware INC. Date: Mon, 09 Jun 2008 10:55:16 -0700 Message-Id: <1213034116.24546.10.camel@promb-2n-dhcp368.eng.vmware.com> Mime-Version: 1.0 X-Mailer: Evolution 2.8.0 (2.8.0-40.el5) Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1620 Lines: 52 On Mon, 2008-06-09 at 06:11 -0700, Ingo Molnar wrote: > * Alok Kataria wrote: > > > --- linux-2.6.orig/arch/x86/kernel/tsc_32.c 2008-05-27 12:28:16.000000000 -0700 > > +++ linux-2.6/arch/x86/kernel/tsc_32.c 2008-06-03 17:28:46.000000000 -0700 > > @@ -401,6 +401,7 @@ > > void __init tsc_init(void) > > { > > int cpu; > > + u64 lpj; > > > > if (!cpu_has_tsc || tsc_disabled) { > > /* Disable the TSC in case of !cpu_has_tsc */ > > @@ -421,6 +422,10 @@ > > return; > > } > > > > + lpj = ((u64)cpu_khz * 1000); > > + do_div(lpj, HZ); > > + lpj_tsc = lpj; > > that wont work very well as lpj_tsc is not declared. lpj_tsc is declared in include/linux/delay.h, and that declaration is available in tsc_32.c I compile tested against current git too and seems fine to me. Also this patch is not to be applied to any tree yet, i will make a different patch which calculates lpj_tsc from tsc_khz instead and use it only for the boor processor. There were some concerns from Arjan and Pavel regarding cpu frequency being different on different cpus. I was waiting to hear back from them before sending a new patch. Let me know your comments on my questions/suggestions from the earlier post http://marc.info/?l=linux-kernel&m=121269125317375&w=2 Thanks, Alok > > Ingo -- 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/