From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755441AbcHSPGG (ORCPT ); Fri, 19 Aug 2016 11:06:06 -0400 Received: from merlin.infradead.org ([205.233.59.134]:36420 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754040AbcHSPGE (ORCPT ); Fri, 19 Aug 2016 11:06:04 -0400 Date: Fri, 19 Aug 2016 17:05:51 +0200 From: Peter Zijlstra To: Steven Rostedt Cc: linux-kernel@vger.kernel.org, Ingo Molnar , Andrew Morton , Clark Williams , Thomas Gleixner , Jon Masters , Daniel Wagner , Carsten Emde , Sebastian Andrzej Siewior , John Stultz Subject: Re: [PATCH v2 0/4] tracing: Add Hardware Latency detector tracer Message-ID: <20160819150551.GE10153@twins.programming.kicks-ass.net> References: <20160810135356.265780824@goodmis.org> <20160819140928.GK10121@twins.programming.kicks-ass.net> <20160819102620.763bd7a0@gandalf.local.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160819102620.763bd7a0@gandalf.local.home> User-Agent: Mutt/1.5.23.1 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Aug 19, 2016 at 10:26:20AM -0400, Steven Rostedt wrote: > > In any case, for those you could probably use ktime_get_mono_fast_ns(). > > Is that safe to call from NMI? It should be, we were very careful to make it so. Also read the comment with __ktime_get_fast_ns(). > Looking into the code I see: > > now = ktime_to_ns(tkr->base) + timekeeping_get_ns(tkr); > > where timekeeping_get_ns() has: > > timekeeping_get_delta() > > which does: > > read_seqcount_begin() > > which has (eventually): That's a bug in CONFIG_DEBUG_TIMEKEEPING, if you look at the !timekeeping_get_delta() it does no such thing. John, looks like 4ca22c2648f9 ("timekeeping: Add warnings when overflows or underflows are observed") buggered things.