From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752466AbbDXAvh (ORCPT ); Thu, 23 Apr 2015 20:51:37 -0400 Received: from mga11.intel.com ([192.55.52.93]:36359 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752399AbbDXAve (ORCPT ); Thu, 23 Apr 2015 20:51:34 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.11,635,1422950400"; d="scan'208";a="700086597" Date: Thu, 23 Apr 2015 17:51:33 -0700 From: Andi Kleen To: Thomas Gleixner Cc: Alexander Shishkin , Ingo Molnar , "H. Peter Anvin" , x86@kernel.org, Don Zickus , Frederic Weisbecker , Adrian Hunter , Anton Blanchard , Michael Ellerman , linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: Re: [PATCH v1] watchdog: Use a reference cycle counter to avoid scaling issues Message-ID: <20150424005133.GK13605@tassilo.jf.intel.com> References: <1429801408-11309-1-git-send-email-alexander.shishkin@linux.intel.com> <20150423203236.GJ13605@tassilo.jf.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 > We can just detect the deviation in the callback itself: > > u64 now = ktime_get_mono_fast_ns(); > > if (now - __this_cpu_read(nmi_timestamp) < period) > return; > > __this_cpu_write(nmi_timestamp, now); > > It's that simple. It's a simple short term hac^wsolution. But if we had a (hypothetical) system with let's say 10*TSC max you may end up with quite a few false ticks, as in unnecessary interrupts. With 100*TSC it would be really bad. There were systems in the past that ran TSC at a much slower frequency, such as the early AMD Barcelona systems. So the problem may eventually come back if not solved properly. -Andi -- ak@linux.intel.com -- Speaking for myself only