Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp4960262imm; Tue, 18 Sep 2018 01:55:57 -0700 (PDT) X-Google-Smtp-Source: ANB0VdaN+TAIGzk74IHjIKTrso5P4QavIq/uT2SKf+Lb5xRbuxeYp6Rxc7yYYmlRCcdMgKhziS6S X-Received: by 2002:a63:2150:: with SMTP id s16-v6mr27069219pgm.267.1537260957472; Tue, 18 Sep 2018 01:55:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537260957; cv=none; d=google.com; s=arc-20160816; b=WB4AM2E06zBMXHVDgzBkivn7krP/6E09xKjQID4TsO3VxkLk9j+xsQqIR8u67DhSs6 +258wNfsRK8a4Udw2KstUzQboQtT4RDZ9fhbHcNWUWq32h2QgvLyEuouFXRrLKSWqG0W ougJyGv1OS8ElOwsUqLDFdtIkrR2b3tUcfdsGoWYTMxaeKrIXPZUWt7M5PxxBN6w8sU6 gjnsYuBDpoD5reN/1pXyquHKU6vhids8MNbFd2+fah+X7wJTQv3Y80YduQZLusR+jxQ4 sei8fmT9iEoU3jLSffppCvslOXwMiCO2Cv/ZeLJ4UNSU4ZtkV8W8K2C24NUg9UC8pde+ 4LOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date; bh=/ksB/yztdwizg0b4s5VR/RLRNrLYjIZm2hLCB6ElPBI=; b=VslJH+jLS08oVrcr9d8lqI64WU1ipxqjig2JoPkjS7ttH90shg8mwD21kTeMQtFIOC 1Rw0geVO36uwfFO1HGdzEsjo7n7RRCUr4YZ8KSgRdBDJxXC9dgi7irpWgVxIYy2w5nxn sk/s4O94n8UpL4mt4N2uMYx24l1Vis/wqwy6yJWuz1ehjdtEHaWM3UVPNuMwjEbOeCcU Cg0aeGKx9DbAUuoHR4PiT9jbFmjgOpq21T20hS9n98GPRsNcR4aCTkWs1LO5wG2dJmLB ktbyebq23+NFKoFGx79wCEpp2KgOTNQC/3xhfasQO1+5MAy8XTA4/NePINhMxc7GBT/C uyWg== ARC-Authentication-Results: i=1; mx.google.com; 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 y13-v6si18109973pgl.555.2018.09.18.01.55.42; Tue, 18 Sep 2018 01:55:57 -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; 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 S1729534AbeIROYw (ORCPT + 99 others); Tue, 18 Sep 2018 10:24:52 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:57185 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727563AbeIROYv (ORCPT ); Tue, 18 Sep 2018 10:24:51 -0400 Received: from hsi-kbw-5-158-153-55.hsi19.kabel-badenwuerttemberg.de ([5.158.153.55] helo=nanos) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1g2Bkq-0005aA-Lk; Tue, 18 Sep 2018 10:53:08 +0200 Date: Tue, 18 Sep 2018 10:52:58 +0200 (CEST) From: Thomas Gleixner To: Peter Zijlstra 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 In-Reply-To: <20180918083055.GJ24106@hirez.programming.kicks-ass.net> Message-ID: References: <20180914125006.349747096@linutronix.de> <20180914125118.909646643@linutronix.de> <20180918083055.GJ24106@hirez.programming.kicks-ass.net> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 18 Sep 2018, Peter Zijlstra wrote: > 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? Because it depends where the involved CPUs are in the topology. The sync code might just run on the same package an simply not see it. Yes, w/o TSC_ADJUST the TSC sync code can just fail to see the havoc. Thanks, tglx