Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp1405038imm; Thu, 4 Oct 2018 13:06:18 -0700 (PDT) X-Google-Smtp-Source: ACcGV61+03Wj2NESlZ+yUiRgc1sMOrsbwUa+7LRpPbIkfbqgBG0ITs5Hpd6oSeL8gOOvM52lRnvR X-Received: by 2002:a62:8559:: with SMTP id u86-v6mr8420695pfd.32.1538683578689; Thu, 04 Oct 2018 13:06:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538683578; cv=none; d=google.com; s=arc-20160816; b=srB2NaLB//xM+n74KmIZYNIBVbSX/a/mniAqBhQQBY+vzURcWVJyDwBCBJhrcWIxDP cI27/g9YP2FcIHLHqcBT4jq6v5AEkMaQkkzMnDil5jJiFhhuomV118tWaGIrq8Li0efS J4dTV4l/eD9eWa6ndin0oMxeepoL8GnHOKrxrbhCV40oAtPdCpxMkG43FQkbMDfU6uTx bTerqOfEnu8Q2VM6ulrMku41aDg4WSy+rQJh/Zb1ypJWsnjfiSCTttusgpi5OdD0IIx2 xyN4FI5BWe4lxpqFQx+6/48vknXJITlrklp6CxU50q3oOqfDeKYPdO+GC4PHeRAnL9to hYYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version:dkim-signature; bh=0noOyB/d0YIJyaZfGPSLOCEgOe+l0ChWQPXnaoXY3i0=; b=jLluHwch0a22edLIuVj3MLpRtno1Wn6IQxpfkwhbyi6n4rO7VSrJezad9GyQr2F9VR AUq/Dxp7dIZ8sb2IXmlAdjZhAePvxBxMdDUWtzaRhbrQUXftWoFzNUhhJcVx9x56o7oY 4F4pB/BUJ99+z8zIWUJrSg63MD02ZYW2fT7nDab5i7YlyjyPKjalSj5AHJSsdrge+tBI muHT12pwDiwNDQtYVKz6bXAZ+BHLGt1P0Har1KdHLunS2Sgxd/8XjOwU04EZ0t9akFCb pClpOlxMfCZSwpSRVvc9RlSY4y8FksWU6+fEx5e/w0FsugBMtW0RJjtPoywHOqtb2HOC d7Kw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amacapital-net.20150623.gappssmtp.com header.s=20150623 header.b="GB93FSb/"; 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 1-v6si6097554plw.121.2018.10.04.13.06.03; Thu, 04 Oct 2018 13:06:18 -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=pass header.i=@amacapital-net.20150623.gappssmtp.com header.s=20150623 header.b="GB93FSb/"; 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 S1727684AbeJEDAm (ORCPT + 99 others); Thu, 4 Oct 2018 23:00:42 -0400 Received: from mail-pl1-f195.google.com ([209.85.214.195]:46120 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727354AbeJEDAm (ORCPT ); Thu, 4 Oct 2018 23:00:42 -0400 Received: by mail-pl1-f195.google.com with SMTP id v5-v6so5680461plz.13 for ; Thu, 04 Oct 2018 13:05:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amacapital-net.20150623.gappssmtp.com; s=20150623; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=0noOyB/d0YIJyaZfGPSLOCEgOe+l0ChWQPXnaoXY3i0=; b=GB93FSb/zaRNdLeMsKLFY60oZ5OGn9MvG8GxLt6HSxti24Kpyv8GfdKZlcF9RiEPY7 w88cjY3B99aaDdm02htbK/jjH9Y/UeUPS9vguVPIyWkb4YVYoRe+PBdYwl6T5pqHLx/v KR5ISVwdv49rYXR15WrMel0A34lcDi+8vD0stpSFL5XxSep6t6TpbAm1/Uq0LzWRHCJe xbox4XRHWn1ckDBdCLiWO0j+x0OTJXRsMExrRwg5pKkCvimbVt2H46JkCx80H4+WcXhI eZlu9bRRgR1cLfeUGL/ahodsIwPpAb91ATXOOdwy+cIypowffKmw4ydcVBjsiaz6LQAG YKcg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=0noOyB/d0YIJyaZfGPSLOCEgOe+l0ChWQPXnaoXY3i0=; b=EBLhWLxXxG0cs+nbHHuhVVWA/ohUqzivrTQgXpx4QIhY+BBjHqsioRFWCMeaqTPOjz TcOaBA3CyjM1SDmCJwMfH+iui21rv5dlM/K1CfEHOF1SCK//qs7XsDM0gZpkKwNlSaX9 BvrUnC3oaME+ZKvT/rt0LTeCQfvqLnL/DEELyDwixU/8An/TNqC9vwjUcWP6yUsMttFt 1KCSWxw7k/3wJA/vEMfu/KpiXJ/Sjt79TYFEfyimfNurgh3NRkVbV7zqkbHpMOGiXkMq O/LD4Q1siNHQheaIfAe5RIa8o3P/ID4eoe5NXtefOvbKF2Xw02CPuTEXnqxLk5hYYVBs SxBA== X-Gm-Message-State: ABuFfoiRobTbGM2QWbgFoMFRSYLrY4eRzxUD/lFZiIFQf1A4Rl4KJdUU SCrLLcISxbZtg65hxpwBQ014bA== X-Received: by 2002:a17:902:7207:: with SMTP id ba7-v6mr8159107plb.266.1538683553218; Thu, 04 Oct 2018 13:05:53 -0700 (PDT) Received: from ?IPv6:2601:646:c200:7429:950e:67bb:f88c:b77f? ([2601:646:c200:7429:950e:67bb:f88c:b77f]) by smtp.gmail.com with ESMTPSA id s85-v6sm9909101pfi.15.2018.10.04.13.05.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 04 Oct 2018 13:05:52 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (1.0) Subject: Re: [patch 00/11] x86/vdso: Cleanups, simmplifications and CLOCK_TAI support From: Andy Lutomirski X-Mailer: iPhone Mail (16A366) In-Reply-To: <20181004193150.GQ19272@hirez.programming.kicks-ass.net> Date: Thu, 4 Oct 2018 13:05:50 -0700 Cc: Vitaly Kuznetsov , Marcelo Tosatti , Andy Lutomirski , Thomas Gleixner , Paolo Bonzini , Radim Krcmar , Wanpeng Li , LKML , X86 ML , Matt Rickard , Stephen Boyd , John Stultz , Florian Weimer , KY Srinivasan , devel@linuxdriverproject.org, Linux Virtualization , Arnd Bergmann , Juergen Gross Content-Transfer-Encoding: quoted-printable Message-Id: <499807AB-E779-40C3-AA3F-E8C77A7770EC@amacapital.net> References: <20180914125006.349747096@linutronix.de> <87sh1ne64t.fsf@vitty.brq.redhat.com> <20181003190617.GC21381@amt.cnet> <87k1mycfju.fsf@vitty.brq.redhat.com> <20181004081100.GI19272@hirez.programming.kicks-ass.net> <20181004193150.GQ19272@hirez.programming.kicks-ass.net> To: Peter Zijlstra Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > On Oct 4, 2018, at 12:31 PM, Peter Zijlstra wrote: >=20 > On Thu, Oct 04, 2018 at 07:00:45AM -0700, Andy Lutomirski wrote: >>> On Oct 4, 2018, at 1:11 AM, Peter Zijlstra wrote:= >>>=20 >>>> On Thu, Oct 04, 2018 at 09:54:45AM +0200, Vitaly Kuznetsov wrote: >>>> I was hoping to hear this from you :-) If I am to suggest how we can >>>> move forward I'd propose: >>>> - Check if pure TSC can be used on SkyLake+ systems (where TSC scaling >>>> is supported). >>>> - Check if non-masterclock mode is still needed. E.g. HyperV's TSC page= >>>> clocksource is a single page for the whole VM, not a per-cpu thing. Can= >>>> we think that all the buggy hardware is already gone? >>>=20 >>> No, and it is not the hardware you have to worry about (mostly), it is >>> the frigging PoS firmware people put on it. >>>=20 >>> Ever since Nehalem TSC is stable (unless you get to >4 socket systems, >>> after which it still can be, but bets are off). But even relatively >>> recent systems fail the TSC sync test because firmware messes it up by >>> writing to either MSR_TSC or MSR_TSC_ADJUST. >>>=20 >>> But the thing is, if the TSC is not synced, you cannot use it for >>> timekeeping, full stop. So having a single page is fine, it either >>> contains a mult/shift that is valid, or it indicates TSC is messed up >>> and you fall back to something else. >>>=20 >>> There is no inbetween there. >>>=20 >>> For sched_clock we can still use the global page, because the rate will >>> still be the same for each cpu, it's just offset between CPUs and the >>> code compensates for that. >>=20 >> But if we=E2=80=99re in a KVM guest, then the clock will jump around on t= he >> same *vCPU* when the vCPU migrates. >=20 > Urgh yes.. >=20 >> But I don=E2=80=99t see how kvmclock helps here, since I don=E2=80=99t th= ink it=E2=80=99s used >> for sched_clock. >=20 > I get hits on kvm_sched_clock, but haven't looked further. Ok, so KVM is using the per-vCPU pvclock data for sched_clock. Which hopeful= ly does something intelligent. Regardless of any TSC syncing issues, a paravirt clock should presumably be u= sed for sched_clock to account for time that the vCPU was stopped. It would be fantastic if this stuff were documented much better, both in ter= ms of the data structures and the Linux code.