Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753504AbbFEF6p (ORCPT ); Fri, 5 Jun 2015 01:58:45 -0400 Received: from mail-wi0-f175.google.com ([209.85.212.175]:37182 "EHLO mail-wi0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751597AbbFEF6m (ORCPT ); Fri, 5 Jun 2015 01:58:42 -0400 Date: Fri, 5 Jun 2015 07:58:37 +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: <20150605055837.GA15407@gmail.com> References: <20150603190719.20769.qmail@ns.horizon.com> <20150604163816.6684.qmail@ns.horizon.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150604163816.6684.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: 1129 Lines: 37 * George Spelvin wrote: > Ingo Molnar wrote: > > - Alternatively, I also tried a different method: to set up the RTC > > periodic IRQ during early boot, but not have an IRQ handler, polling > > RTC_PF in the rtc_cmos_read(RTC_INTR_FLAGS) IRQ status byte. > > > > Unfortunately when I do this then PIO based RTC accesses can take > > tens of thousands of cycles, and the resulting jitter is pretty bad > > and hard to filter: > > Did you use rtc_cmos_read()? [...] Yeah, so initially I did, but then after I noticed the overhead I introduced: +unsigned char rtc_cmos_read_again(void) +{ + return inb(RTC_PORT(1)); +} + 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. 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/