Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp4941454imm; Tue, 18 Sep 2018 01:32:11 -0700 (PDT) X-Google-Smtp-Source: ANB0VdaIn+GcG+r962noErFAT8cj5RLbgU6DuxI0uXE+r6pQ54DcYXaMrUi+k+Mj3kIV8tYuySms X-Received: by 2002:a63:fd06:: with SMTP id d6-v6mr26318037pgh.348.1537259530921; Tue, 18 Sep 2018 01:32:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537259530; cv=none; d=google.com; s=arc-20160816; b=tPC7kdUkS0xR+KghraTn44Dex5tFVqpW3P9KCg6YENWxPQ+LVuyxIovG3OkXN3krR0 FwwxNubuNpGnY6HCDfg0lT7raJRcM/vhLz8EQ+GddpRbreJquyOCwfKXuV6tRRUnjxnL KwER1fBOxNohdoXS1LHo9jRmaHMcrt6T1GYAjBdfYfAKeyn7bF9qa07Q4nCaDKKpCzAr qyeZPMDg2nyfm2IMUdu8VYHr6EsUP0CQ8hdy7ftb+MFAZgmt+31PL9Znmu6N09YcDL0P xz/qwklBFdO+HF7grl/kCtkKq1htxuFCPDcFeu/B1Ps1GaNF6IWpftLKRajHfXeDmdnR qrbg== 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=HG5pVcepxQN629X8V7hoyBkBwLrtFAJyhvA4se7CUsg=; b=DFN1sIrk1+9Su9/OzOB7PYLKU/lpjFE1i3VdT4nZLjnZkZTid1rvuwI+weq+XUDK8/ 5AOvIzD6RPnZsexnG0eKxyAMPvsRa+HjZIEg8UWIAlP6BMCNWPvm0hV1j6we3AWZOMIw LWelvWpWfKTgTpD0g69UVT4WqDebJLKOsx734CUofRjVfxlXmHS9z8XAzdkSjPnETg19 mXoTn7SSfEew1LlSSv9etDc8y0RwlpzD2D5ZDHZBDrLqBgq107PleonFHXvkJNaIkyMr SM588/r6axUgysj6ZPz7TxJC+E3Mjx4FEUNc2T9NawUNAuplIR2vE9bd966EEdITI2yW 2nww== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=Lt26I3wJ; 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 y10-v6si17569109pgf.312.2018.09.18.01.31.55; Tue, 18 Sep 2018 01:32:10 -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=merlin.20170209 header.b=Lt26I3wJ; 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 S1729442AbeIROCw (ORCPT + 99 others); Tue, 18 Sep 2018 10:02:52 -0400 Received: from merlin.infradead.org ([205.233.59.134]:48116 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729129AbeIROCw (ORCPT ); Tue, 18 Sep 2018 10:02:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.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=HG5pVcepxQN629X8V7hoyBkBwLrtFAJyhvA4se7CUsg=; b=Lt26I3wJbL4vC5nE+nKKj2p3d aLx892kRv1tq4P7x9qgJnOdWuGfxbCFIDp6CpIgiW6MYKfVUuvdNxanwaf4GNzmNAWwhSEGTU6nFW dJyQw2iblsI3FoCBpxs8GNyP8kX65OvKxJpYVWDqmF4e3UfAUxvqzS9/mQKGDKDKnry0FTJg6a/Mj RZplKFHpYZmsLx7rMiN/AEuB1GPaNMR/GYEWKwj0vp+oMxHlSbGcCGbZdYWJGBVd0Gd9o5BQ4Nuu+ 3KmWEukQNr01e4z7N9GN693NH+gOm3PXE8A+0IRS9u6/CKwcvCSWDfcEWzxxZ9TqkJipAU2pzKjsS YNUu0fWZg==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1g2BPO-0000vj-Kk; Tue, 18 Sep 2018 08:30:58 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id B48D9202C1A35; Tue, 18 Sep 2018 10:30:55 +0200 (CEST) Date: Tue, 18 Sep 2018 10:30:55 +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: <20180918083055.GJ24106@hirez.programming.kicks-ass.net> References: <20180914125006.349747096@linutronix.de> <20180914125118.909646643@linutronix.de> 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 09:52:26AM +0200, Thomas Gleixner wrote: > On Mon, 17 Sep 2018, John Stultz wrote: > > On Mon, Sep 17, 2018 at 12:25 PM, Andy Lutomirski wrote: > > > Also, I'm not entirely convinced that this "last" thing is needed at > > > all. John, what's the scenario under which we need it? > > > > So my memory is probably a bit foggy, but I recall that as we > > accelerated gettimeofday, we found that even on systems that claimed > > to have synced TSCs, they were actually just slightly out of sync. > > Enough that right after cycles_last had been updated, a read on > > another cpu could come in just behind cycles_last, resulting in a > > negative interval causing lots of havoc. > > > > So the sanity check is needed to avoid that case. > > Your memory serves you right. That's indeed observable on CPUs which > lack TSC_ADJUST. But, if the gtod code can observe this, then why doesn't the code that checks the sync?