From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752741AbbJPMq3 (ORCPT ); Fri, 16 Oct 2015 08:46:29 -0400 Received: from www.linutronix.de ([62.245.132.108]:37581 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750807AbbJPMq2 (ORCPT ); Fri, 16 Oct 2015 08:46:28 -0400 Date: Fri, 16 Oct 2015 14:45:37 +0200 (CEST) From: Thomas Gleixner To: Heiko Carstens cc: Stefan Liebler , Preeti U Murthy , Peter Zijlstra , linux-kernel@vger.kernel.org Subject: Re: futex timeout not working? (bisected) In-Reply-To: Message-ID: References: <20151015104347.GA4166@osiris> <20151016103123.GE4684@osiris> <20151016105451.GB6354@osiris> <20151016115003.GC6354@osiris> User-Agent: Alpine 2.11 (DEB 23 2013-08-11) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Heiko, On Fri, 16 Oct 2015, Thomas Gleixner wrote: > On Fri, 16 Oct 2015, Heiko Carstens wrote: > > Adding the patch below also "fixes" this. Right now I don't see why this > > could architecture specific. Hmm. > > > > diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c > > index 3739ac6aa473..75771b15647c 100644 > > --- a/kernel/time/timekeeping.c > > +++ b/kernel/time/timekeeping.c > > @@ -1835,7 +1835,7 @@ void update_wall_time(void) > > * memcpy under the tk_core.seq against one before we start > > * updating. > > */ > > - timekeeping_update(tk, clock_set); > > + timekeeping_update(tk, clock_set | TK_CLOCK_WAS_SET); > > memcpy(real_tk, tk, sizeof(*tk)); > > /* The memcpy must come last. Do not put anything here! */ > > write_seqcount_end(&tk_core.seq); > > Well, the latter is incrementing the sequence count on every wall time > update. > > The question is why the hrtimer code is not seeing that the clock was > set at some point during boot. > > Lemme dig into that. The only point I found which does not update the sequence count is timekeeping_init(). Does the patch below fix your issue? Thanks, tglx 8<-------------------- diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c index 3739ac6aa473..44d2cc0436f4 100644 --- a/kernel/time/timekeeping.c +++ b/kernel/time/timekeeping.c @@ -1251,7 +1251,7 @@ void __init timekeeping_init(void) set_normalized_timespec64(&tmp, -boot.tv_sec, -boot.tv_nsec); tk_set_wall_to_mono(tk, tmp); - timekeeping_update(tk, TK_MIRROR); + timekeeping_update(tk, TK_MIRROR | TK_CLOCK_WAS_SET); write_seqcount_end(&tk_core.seq); raw_spin_unlock_irqrestore(&timekeeper_lock, flags);