Received: by 2002:ac0:a679:0:0:0:0:0 with SMTP id p54csp1577769imp; Fri, 22 Feb 2019 06:29:20 -0800 (PST) X-Google-Smtp-Source: AHgI3IZ1/6dATc4nr38IRZ/0Cg1JpS6eXRdbJbTMNTcJpQcE1S40fa0AT09Sb2irinf8kFYJfwIj X-Received: by 2002:a62:6282:: with SMTP id w124mr4512528pfb.168.1550845760559; Fri, 22 Feb 2019 06:29:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550845760; cv=none; d=google.com; s=arc-20160816; b=thIAlhDygPo525AJ03a21tzVdneGSGwUX5ZqJzQpf5Pue6df7v+ScMVfmT5GCJONu5 8BvLcN9p8uX9GTkexkry4GYZ1ccR78826RbBdwAaLxVQyunPj3vpoh2xzdrmbtLrUo+Y 5kywU8wgsUQ3QSXghS5MRYglSU5pu9aMN6nXz/28bhoCydpYRj17jwNOVQff259hYWgU qooHmtAWnF3aFtuv4NECQTTtIW5ZCnZNuuHGejKUn1Lakw4YvtSg1vKIfLyJ5GxOHQLh ro/QtXwCvNeAVCqjbWLM80ucBWl+VOJc8BoOWPGKdp6YVnYBXkhSuzZgqSeLqi2hstl5 +BOg== 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=U1HZ5hqsM7AaTAXIE+Qz1wTiIY/Ai6ETOm9gqRYmKB0=; b=zDMkz602/7ThnA8Mujok+BfxgYMkLRHQUlS+rIghEXRk5DnJnbKVVkdFD66jgJ57AR EMRlvUpX2R9qGjh1+lMZkPwRReHorqa/mtRO6ythNexxUByF0mYvVYWTPxcEVP71qDh0 YvaqGEKWT/9MhGZ3arXouvSVK0wjgnUyHFes10HJM5AYBm8klEzUy1oTqmncE/TCnhEa 22LBNvbJZxM7yHptk8kuWMIKpkapxUpxUmcbD4FF8hAkhW8PXTI8xAvdkaZGtDVpjMIX YyE3/lqkkwrRB685q7mT/HCZgLrERbFBQNUQR7eUgBrv5Y4QqmE4uxyhBsDWRru7m7b0 dBEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@aepfle.de header.s=strato-dkim-0002 header.b=h4Av5GWj; 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 g63si1434624pgc.382.2019.02.22.06.29.04; Fri, 22 Feb 2019 06:29:20 -0800 (PST) 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=@aepfle.de header.s=strato-dkim-0002 header.b=h4Av5GWj; 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 S1726492AbfBVO2n (ORCPT + 99 others); Fri, 22 Feb 2019 09:28:43 -0500 Received: from mo4-p00-ob.smtp.rzone.de ([85.215.255.22]:34363 "EHLO mo4-p00-ob.smtp.rzone.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726325AbfBVO2m (ORCPT ); Fri, 22 Feb 2019 09:28:42 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1550845720; s=strato-dkim-0002; d=aepfle.de; h=In-Reply-To:References:Message-ID:Subject:Cc:To:From:Date: X-RZG-CLASS-ID:X-RZG-AUTH:From:Subject:Sender; bh=U1HZ5hqsM7AaTAXIE+Qz1wTiIY/Ai6ETOm9gqRYmKB0=; b=h4Av5GWjETVu/C9/Zk+NPD5/JcfBhpfWdkiLj28QrPt9IEihasn4KSAwCX5k5+dsux Syx+RGlP2c7yQjje6S72zoKW+XL9LS47UY85zy3f1X+cAOJqQToX3PQHc2v1VA4sraBs tlucp+iZKwLtpNyTNYcYKsd76XK+1nByhJvoM= X-RZG-AUTH: ":P2EQZWCpfu+qG7CngxMFH1J+3q8wa/QXkBR9MXjAuzpIG0mv9coXAgc09FajRctxF8avNjL8BIaOzrboMVGNhg5iLfM=" X-RZG-CLASS-ID: mo00 Received: from aepfle.de by smtp.strato.de (RZmta 44.12 AUTH) with ESMTPSA id R08017v1MESekTC (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (curve secp521r1 with 521 ECDH bits, eq. 15360 bits RSA)) (Client did not present a certificate); Fri, 22 Feb 2019 15:28:40 +0100 (CET) Date: Fri, 22 Feb 2019 15:28:36 +0100 From: Olaf Hering To: Paolo Bonzini Cc: Thomas Gleixner , John Stultz , Stephen Boyd , LKML , x86@kernel.org Subject: Re: recalibrating x86 TSC during suspend/resume Message-ID: <20190222142836.GA14744@aepfle.de> References: <20190222105302.GA26398@aepfle.de> <036fab04-0c1b-134d-a170-399b2dc6ab5f@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="SLDf9lqlvOQaIe6s" Content-Disposition: inline In-Reply-To: <036fab04-0c1b-134d-a170-399b2dc6ab5f@redhat.com> User-Agent: Mutt/1.11.3 (20190207T234809.c483d3c3) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --SLDf9lqlvOQaIe6s Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Feb 22, Paolo Bonzini wrote: > On 22/02/19 12:44, Thomas Gleixner wrote: > >> The specific usecase I have is a workload within VMs that makes heavy > >> use of TSC. The kernel is booted with 'clocksource=3Dtsc highres=3Doff= nohz=3Doff' > >> because only this clocksource gives enough granularity. The default > >> paravirtualized clock will return the same values via > >> clock_gettime(CLOCK_MONOTONIC) if the timespan between two calls is too > >> short. This does not happen with 'clocksource=3Dtsc'. >=20 > This shouldn't happen. clock_gettime(CLOCK_MONOTONIC) should be > monotonic increasing. Do you have a testcase? Two years ago I tweaked sysbench to track the execution time of the 'memory' test: https://github.com/olafhering/sysbench https://github.com/olafhering/sysbench/blame/pv/src/tests/memory/sb_memory.c The checks in diff_timespec() triggered with clocksource=3Dxen, but I can not reproduce it right now with 5.0 and 4.4 based kernels. I have no data how KVM behaves. In the end the hypervisor was tweaked to tolerate a certain jitter in expected TSC speed before emulation kicks in. Up to ~1MHz would be ok to stay within the 500PPM limit that ntpd can handle. But now there is that "island" issue that needs to be resolved in one way or another. Olaf --SLDf9lqlvOQaIe6s Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EARECAB0WIQSkRyP6Rn//f03pRUBdQqD6ppg2fgUCXHAHEAAKCRBdQqD6ppg2 fnzCAKCxHIeYXFSa14XpUTZpfglkb21WywCg7EFBbRgWebESoVVMPmQkLBshGRQ= =JtGU -----END PGP SIGNATURE----- --SLDf9lqlvOQaIe6s--