Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933472AbbKRXx6 (ORCPT ); Wed, 18 Nov 2015 18:53:58 -0500 Received: from mga09.intel.com ([134.134.136.24]:51871 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756138AbbKRXx4 (ORCPT ); Wed, 18 Nov 2015 18:53:56 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,315,1444719600"; d="scan'208";a="841908563" Date: Wed, 18 Nov 2015 15:53:53 -0800 From: Jacob Pan To: "Hall, Christopher S" Cc: "Kirsher, Jeffrey T" , "hpa@zytor.com" , "mingo@redhat.com" , "tglx@linutronix.de" , "john.stultz@linaro.org" , "peterz@infradead.org" , "x86@kernel.org" , "intel-wired-lan@lists.osuosl.org" , "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "Stanton, Kevin B" , jacob.jun.pan@intel.com Subject: Re: [PATCH v4 2/4] Always running timer correlated clocksource Message-ID: <20151118155353.4b37a06f@yairi> In-Reply-To: <1444675522-4198-3-git-send-email-christopher.s.hall@intel.com> References: <1444675522-4198-1-git-send-email-christopher.s.hall@intel.com> <1444675522-4198-3-git-send-email-christopher.s.hall@intel.com> Organization: OTC X-Mailer: Claws Mail 3.9.3 (GTK+ 2.24.23; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1438 Lines: 42 On Mon, 12 Oct 2015 11:45:20 -0700 "Hall, Christopher S" wrote: took a while to read the code, i have a few comments/questions > > diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c > index c3f7602..c3f098c 100644 > --- a/arch/x86/kernel/tsc.c > +++ b/arch/x86/kernel/tsc.c > @@ -820,7 +820,7 @@ int recalibrate_cpu_khz(void) > #ifndef CONFIG_SMP This code is used by old p4/k7 clock modulation driver, why do we care? > unsigned long cpu_khz_old = cpu_khz; > > - if (cpu_has_tsc) { > + if (boot_cpu_has(X86_FEATURE_ART)) { > tsc_khz = x86_platform.calibrate_tsc(); > cpu_khz = tsc_khz; > cpu_data(0).loops_per_jiffy = > > +/* > + * Convert ART to TSC given numerator/denominator found in > detect_art() > + */ > +static u64 convert_art_to_tsc(struct correlated_cs *cs, u64 cycles) > +{ > + u64 tmp, res; > + > + res = (cycles / art_to_tsc_denominator) * > art_to_tsc_numerator; > + tmp = (cycles % art_to_tsc_denominator) * > art_to_tsc_numerator; > + res += tmp / art_to_tsc_denominator; > + iirc there are some issues with 32bit, better use div64_u64() -- 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/