Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp5248426imm; Tue, 18 Sep 2018 06:41:39 -0700 (PDT) X-Google-Smtp-Source: ANB0VdaRVRTBNRym4fFB/hJpYSogVFn6UUe8vz7RfRsJYQpvQKuMzfBJE8dcIWFqpke7PxQg2++7 X-Received: by 2002:a63:2f45:: with SMTP id v66-v6mr27534841pgv.91.1537278099100; Tue, 18 Sep 2018 06:41:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537278098; cv=none; d=google.com; s=arc-20160816; b=DltyxgosHkl7ttuXFnyGwFA/Y78fBaZbPt9YnbRmawsNCJL1dHfeQ7qTTNPpglPJwI jpHHqv2tChBVb32qlItceN3Az5dK0AbG+P30GljHvb8acD/j5Eqat7rtwBhua8mudcI/ OoH4pQMNo8Stj1SOIoDYjyl6A5EdfbuWPiI2dhB4cG64w0YtfPWtwB9eJFqP2LH+TF4d SDv8pl4lnV+D1WMwZwlSyfmVTy0KwppsxZUEU6kgl7hDlmaC0R3PvmGKW0eMBgKsbNzo NBNwTIZOUpZoEVusIuK5XHNHoUfjQlMX2vDpLyb/nRw7SEMNAairib2Ef0mnYGsnWaR/ 3Qfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=VMfiXEWTYF3RsxNG4UrwIUiJgIWVdrHK2LA3xVZtbAg=; b=toUKU9vYpMxbObdtboT2RL8Rvi0QUYafYBmQq7dwh8VSi1bb6Itu38yM7W3zgFWxll 6Oxp1/LzVwAEOdRx4G8Vugk3PjEu/1pGB2e7lmdTBjQfCg8i6oEkKBr6tZpctGK/IsNv g+xbep0noirF0fa6ph7juRU7OvvE1pBGDi1W9Ea3c8tXC5RJIonI3AdVMYL5rDK3T8Bx /s4cKiqMiT6RR0okGJx0WJNBdYQXuz17KEKm2UvP5+zp0kvkSxaDWf5i0s9R+v6YC3z0 3TsXbHnmsIoIw6IMv+y1kalEVrnIMJCjEA1u2oUkE2Dx6iGWGi/UvwldCI9Tdyqw3TMi lv8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=tMO7pAn5; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o20-v6si19112103pgb.608.2018.09.18.06.41.15; Tue, 18 Sep 2018 06:41:38 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=tMO7pAn5; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729867AbeIRTLj (ORCPT + 99 others); Tue, 18 Sep 2018 15:11:39 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:54830 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728718AbeIRTLj (ORCPT ); Tue, 18 Sep 2018 15:11:39 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=VMfiXEWTYF3RsxNG4UrwIUiJgIWVdrHK2LA3xVZtbAg=; b=tMO7pAn5V5s4l2HVPw5gz97i8 KSHEQ97CcvyBtRz+uXmP3GdQrzWwOv6P9RKL41Pdxd4LvWWMdQRgSbsMI9NCvM298G74wnEof2I3M jyjqIlrw/vWV6a0b19OqUfSRAL99Bo8Y8a73AS34vdSA3Dkc8YJCUPKr0cRPTu7DL4BhjnbW2Zod8 RHHI2yBvDV5d8hEyAbnXHehxFTxEfjFb997npKLcLEJvT4NIzh01hYl0vNmMVRlG9Vbq3vvIOxvQ+ H8nyohYY5kY2gryN8rmiJN1pnrNoir3q5sQ+NSjRCNU1WuDDN9kGFag8TcfzIDMIkQgeAJMkcXVYQ 6UUoRKvNA==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1g2GDO-000171-5x; Tue, 18 Sep 2018 13:38:54 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 15A75202C1A38; Tue, 18 Sep 2018 15:38:52 +0200 (CEST) Date: Tue, 18 Sep 2018 15:38:52 +0200 From: Peter Zijlstra To: Thomas Gleixner Cc: John Stultz , Andy Lutomirski , LKML , X86 ML , Matt Rickard , Stephen Boyd , Florian Weimer , "K. Y. Srinivasan" , Vitaly Kuznetsov , devel@linuxdriverproject.org, Linux Virtualization , Paolo Bonzini , Arnd Bergmann , Juergen Gross Subject: Re: [patch 09/11] x86/vdso: Simplify the invalid vclock case 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-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.0 (2018-05-17) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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.