Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp1944805imd; Fri, 2 Nov 2018 03:26:55 -0700 (PDT) X-Google-Smtp-Source: AJdET5cJ8ThEj80Voc2WGwr3QP4hiwQ6s3h8VW3yXao6QlBEfduZ4bMd20s1SwR6FeM0rJl34T/D X-Received: by 2002:a17:902:7d8f:: with SMTP id a15-v6mr3937532plm.111.1541154415763; Fri, 02 Nov 2018 03:26:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541154415; cv=none; d=google.com; s=arc-20160816; b=o0uSOvJK2SyvoKHYQm1rRIuYaeGlJxUN4LMPTZxClPkkulM+m8mLYFSgO3ocpO6BK5 SrkOt/AtMcq3F8wcjZj70Gx0jfpKa1FkgU21Ve3YcR06dQsUgipHFaV3ZJ42Ty+r3SBo tEUXns+6g17cZlNeMQk1MQsP9VYse3TFdDQDCHAcyAj2k17lccmU6+2VaKqUW1apugdt xxpH6AZczCO1vMFWiFR/tVzTXGOwudKG4xDHq2Yc05WEDYtwHoEja+1tIIVbIMxr1djv otN5h6rUMBUvv5y4ymjNJG//xLtupOVrD7wzXqRvD55huFjglnIxBk5/2utZWJeK7nSb nBSA== 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; bh=6VpxkNGZw9Qyp1Epam40/I4Xk3yavWi8ZLOM5jCgl1s=; b=ulr0h489u+DeIhCswvp6hCZLJ+3Gpe8ebnv0AlJIhOXW+DKeKIu5LI15QwA4UYWzci i0wi+dAKPpw9d3RUfYJVy2xox1dC25vStLiVwI8wOz3fyeNMm28NhSPkcKeU1ro1S1lK lFJqfW00K0kUED+5RvQ4CvErzT/C5kJLeEmpZPSEU4HGQ1mOEn8nwKSoAqlEXEhHLdkL tUhw/ZYkgJ+bZdQnBYPsFxy8Ry6RXqvLx126iH8Mm/yWTMPzK2tcqDX4IXgoyjZNrTHj 5Uw28gzQlrdHy3EgcnTRB0ANdFW0AdwRftG0O3sUm+dCon0vkPPRvlYapNAGkkLq6z1R eUdQ== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id az8-v6si27437183plb.166.2018.11.02.03.26.38; Fri, 02 Nov 2018 03:26:55 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726265AbeKBTc5 (ORCPT + 99 others); Fri, 2 Nov 2018 15:32:57 -0400 Received: from mx1.redhat.com ([209.132.183.28]:51966 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725990AbeKBTc5 (ORCPT ); Fri, 2 Nov 2018 15:32:57 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8D2AB31256B4; Fri, 2 Nov 2018 10:26:17 +0000 (UTC) Received: from localhost (holly.tpb.lab.eng.brq.redhat.com [10.43.134.11]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 801A0600CD; Fri, 2 Nov 2018 10:26:15 +0000 (UTC) Date: Fri, 2 Nov 2018 11:26:13 +0100 From: Miroslav Lichvar To: Thomas Gleixner Cc: John Stultz , Christopher Hall , "H. Peter Anvin" , linux-rt-users , jesus.sanchez-palencia@intel.com, Gavin Hindman , liam.r.girdwood@intel.com, Peter Zijlstra , LKML Subject: Re: TSC to Mono-raw Drift Message-ID: <20181102102613.GL19434@localhost> References: <20181024145113.GF12019@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.46]); Fri, 02 Nov 2018 10:26:17 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 01, 2018 at 06:41:00PM +0100, Thomas Gleixner wrote: > On Wed, 24 Oct 2018, Miroslav Lichvar wrote: > > The error is too large to be corrected by stepping on clock updates. > > For a typical TSC frequency we have multiplier in the range of few > > millions, so that's a frequency error of up to few hundred ppb. In the > > old days when the clock was updated 1000 times per second that would > > be hidden in the resolution of the clock, but now with tickless > > kernels those steps would be very noticeable. > That only happens when the system was completely idle for a second and in > that case it's a non issue because the clock is updated before it's > used. So nothing will be able to observe the time jumping forward by a few > or even a few hundreds of nanoseconds. That's great news (to me). I think we should do the same with the mono/real clock. A periodic 4ns step would be better than a slew correcting tens or hundreds of nanoseconds. This would be a significant improvement in accuracy on idle systems, in theory identical to running with nohz=off. Maybe I am missing some important detail, but I think we can just drop the +1 mult adjustment and step on each update by the (truncated) amount that has accumulated in the NTP error register. With the changes that have been made earlier this year the clock should never be ahead, so the step would always be forward. > For the regular case, where CPUs are > busy and the update happens 100/250/1000 times per second the jump forward > will not be noticable at all. I think a 4ns jump at 100 Hz might be noticeable with a good reference clock and large number of measurements, but so would be the current +1 mult adjustment. -- Miroslav Lichvar