Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1033673AbdDTR4k (ORCPT ); Thu, 20 Apr 2017 13:56:40 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:36301 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1033655AbdDTR4h (ORCPT ); Thu, 20 Apr 2017 13:56:37 -0400 Date: Thu, 20 Apr 2017 19:56:22 +0200 (CEST) From: Thomas Gleixner To: Frederic Weisbecker cc: Ingo Molnar , LKML , Peter Zijlstra , Rik van Riel , James Hartsock , stable@vger.kernel.org, Tim Wright , Pavel Machek Subject: Re: [PATCH 2/2] tick: Make sure tick timer is active when bypassing reprogramming In-Reply-To: <1492702230-28462-3-git-send-email-fweisbec@gmail.com> Message-ID: References: <1492702230-28462-1-git-send-email-fweisbec@gmail.com> <1492702230-28462-3-git-send-email-fweisbec@gmail.com> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1469 Lines: 39 On Thu, 20 Apr 2017, Frederic Weisbecker wrote: > So far we have run into too much troubles with the optimization path > that skips reprogramming the clock on IRQ exit when the expiration > deadline hasn't changed. If by accident the cached deadline happens to > be out of sync with the hardware deadline, the buggy result and its > cause are hard to investigate. So lets detect and warn about the issue > early. > > Signed-off-by: Frederic Weisbecker > Cc: Tim Wright > Cc: Pavel Machek > Cc: James Hartsock > Cc: Peter Zijlstra > Cc: Rik van Riel > Cc: Thomas Gleixner > Cc: Ingo Molnar > --- > kernel/time/tick-sched.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c > index 502b320..eb1366e 100644 > --- a/kernel/time/tick-sched.c > +++ b/kernel/time/tick-sched.c > @@ -783,8 +783,10 @@ static ktime_t tick_nohz_stop_sched_tick(struct tick_sched *ts, > tick = expires; > > /* Skip reprogram of event if its not changed */ > - if (ts->tick_stopped && (expires == ts->next_tick)) > + if (ts->tick_stopped && (expires == ts->next_tick)) { > + WARN_ON_ONCE(dev->next_event > ts->next_tick); What about handling it proper ? dev->next_event might be KTIME_MAX, i.e. no more event for the next 500+ years. Thanks, tglx