Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754288AbbFEIbQ (ORCPT ); Fri, 5 Jun 2015 04:31:16 -0400 Received: from mail-wi0-f175.google.com ([209.85.212.175]:35861 "EHLO mail-wi0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751285AbbFEIbM (ORCPT ); Fri, 5 Jun 2015 04:31:12 -0400 Date: Fri, 5 Jun 2015 10:31:07 +0200 From: Ingo Molnar To: George Spelvin Cc: adrian.hunter@intel.com, ak@linux.intel.com, hpa@zytor.com, linux-kernel@vger.kernel.org, luto@amacapital.net, tglx@linutronix.de, torvalds@linux-foundation.org Subject: Re: [PATCH RFC] x86, tsc: Allow for high latency in quick_pit_calibrate() Message-ID: <20150605083107.GA29843@gmail.com> References: <20150605055837.GA15407@gmail.com> <20150605082453.11539.qmail@ns.horizon.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150605082453.11539.qmail@ns.horizon.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1719 Lines: 47 * George Spelvin wrote: > > Ingo Molnar wrote: > >* George Spelvin wrote: > >> Did you use rtc_cmos_read()? [...] > > > Yeah, so initially I did, but then after I noticed the overhead I introduced: > > which compiles to a single INB instruction. > > > > This didn't change the delay/cost behavior. > > > > The numbers I cited, with tens of thousands of cycles per iteration, > > were from such an optimized poll loop already. > > Apologies for doubting you! No apologies needed: I should really have posted my code, but the boot dependencies hackery I had to perform was way too embarrasing to post ... > > note the 'loops' column. When it's around 117, then the read cost corresponds > > roughly to the cheap-ish INB cost you have measured: 4188 cycles/loop. > > > > But note the frequent 30-40k cycles/loop outliers. They dominate the > > measurement so filtering might not help. > > I don't quite understand hoe the numbers are derived. Why does 200K > cycles/loop give 13 loops, while 35K cycles/loop gives 7? Is cycles/loop > a maximum? it's delta/loops. So the 200K line: [ 0.000000] tsc: RTC edge 69 from 0 to 64, at 29700569301, delta: 2700528, jitter: 2454456, loops: 13, 207732 cycles/loop had a very big 'delta' outlier, ~1.3 msecs when we did not manage to detect any RTC edge. I'll run your code as well, to make sure it's not something bad in my code. Thanks, 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/