From mboxrd@z Thu Jan 1 00:00:00 1970 From: Peter Zijlstra Subject: Re: [patch 09/11] x86/vdso: Simplify the invalid vclock case Date: Tue, 18 Sep 2018 15:38:52 +0200 Message-ID: <20180918133852.GO24106@hirez.programming.kicks-ass.net> References: <20180914125118.909646643@linutronix.de> <20180918083055.GJ24106@hirez.programming.kicks-ass.net> <20180918124800.GL24106@hirez.programming.kicks-ass.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: virtualization-bounces@lists.linux-foundation.org Errors-To: virtualization-bounces@lists.linux-foundation.org To: Thomas Gleixner Cc: Florian Weimer , Juergen Gross , Arnd Bergmann , Stephen Boyd , X86 ML , LKML , Linux Virtualization , John Stultz , Andy Lutomirski , Paolo Bonzini , devel@linuxdriverproject.org, Matt Rickard List-Id: virtualization@lists.linuxfoundation.org On Tue, Sep 18, 2018 at 03:23:08PM +0200, Thomas Gleixner wrote: > On Tue, 18 Sep 2018, Peter Zijlstra wrote: > > On Tue, Sep 18, 2018 at 12:41:57PM +0200, Thomas Gleixner wrote: > > > I still have one of the machines which is affected by this. > > > > Are we sure this isn't a load vs rdtsc reorder? Because if I look at the > > current code: > > The load order of last vs. rdtsc does not matter at all. > > CPU0 CPU1 > > .... > now0 = rdtsc_ordered(); > ... > tk->cycle_last = now0; > > gtod->seq++; > gtod->cycle_last = tk->cycle_last; > ... > gtod->seq++; > seq_begin(gtod->seq); > now1 = rdtsc_ordered(); > > So if the TSC on CPU1 is slightly behind the TSC on CPU0 then now1 can be > smaller than cycle_last. The TSC sync stuff does not catch the small delta > for unknown raisins. I'll go and find that machine and test that again. Yeah, somehow I forgot about rseq.. maybe I should go sleep or something.