linux-kselftest.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Miroslav Lichvar <mlichvar@redhat.com>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: John Stultz <jstultz@google.com>,
	LKML <linux-kernel@vger.kernel.org>,
	Stephen Boyd <sboyd@kernel.org>,
	Anna-Maria Behnsen <anna-maria@linutronix.de>,
	Frederic Weisbecker <frederic@kernel.org>,
	Shuah Khan <shuah@kernel.org>,
	linux-kselftest@vger.kernel.org, kernel-team@android.com,
	Lei Chen <lei.chen@smartx.com>
Subject: Re: [PATCH v2 1/2] time/timekeeping: Fix possible inconsistencies in _COARSE clockids
Date: Thu, 3 Apr 2025 10:32:21 +0200	[thread overview]
Message-ID: <Z-5HlSUEh1xgCi4f@localhost> (raw)
In-Reply-To: <87iknnwxa4.ffs@tglx>

On Tue, Apr 01, 2025 at 08:29:23PM +0200, Thomas Gleixner wrote:
> On Tue, Apr 01 2025 at 13:19, Miroslav Lichvar wrote:
> > It seems to improve the worst cases, but overall it's still
> > a regression.
> >
> > Mult reduction	Updates/sec	Skew
> > 16		4		0.012
> > 16		16		0.014
> > 16		64	        0.033
> > 64		4		0.012
> > 64		16		0.105
> > 64		64		0.138
> 
> That's weird as it only delays the update to the next tick.

Ok, so it's not an instability of the clock, but rather an instability
of the chronyd synchronization loop, which since kernel 4.19 expects
the frequency to be applied as soon as the adjtimex call is finished.
To confirm that, I tried a different test with chronyd configured to
only monitor the clock without making any adjustments (-x option) and
another process repeatedly setting the same frequency. The one-line
patch does fix that test.

> My original
> approach of maintaining seperate state for the coarse time keeper is
> preserving the existing NTP behaviour.
> 
> Patch applies after reverting 757b000f7b93 ("timekeeping: Fix possible
> inconsistencies in _COARSE clockids").

I ran multiple longer tests to be able to compare the small values in
the noise and yes, from the adjtimex point of view this seems to work
as well as before the first COARSE fix. I didn't run any tests of the
COARSE clock.

Thanks,

-- 
Miroslav Lichvar


  reply	other threads:[~2025-04-03  8:32 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-20 20:03 [PATCH v2 1/2] time/timekeeping: Fix possible inconsistencies in _COARSE clockids John Stultz
2025-03-20 20:03 ` [PATCH v2 2/2] selftests/timers: Improve skew_consistency by testing with other clockids John Stultz
2025-03-25 11:32 ` [PATCH v2 1/2] time/timekeeping: Fix possible inconsistencies in _COARSE clockids Miroslav Lichvar
2025-03-27  9:22   ` Thomas Gleixner
2025-03-27 15:42     ` Miroslav Lichvar
2025-03-27 17:32       ` Thomas Gleixner
2025-03-31  7:53         ` Miroslav Lichvar
2025-04-17  2:55           ` John Stultz
2025-03-31 14:53       ` Miroslav Lichvar
2025-04-01  6:34         ` Thomas Gleixner
2025-04-01 11:19           ` Miroslav Lichvar
2025-04-01 18:29             ` Thomas Gleixner
2025-04-03  8:32               ` Miroslav Lichvar [this message]
2025-04-03 11:29                 ` Thomas Gleixner
2025-04-05 21:40                   ` [PATCH] timekeeping: Prevent coarse clocks going backwards Thomas Gleixner
2025-04-17  5:29                     ` John Stultz
2025-04-17 12:36                       ` Thomas Gleixner
2025-04-18  0:46                     ` John Stultz
2025-04-18  6:37                       ` Thomas Gleixner
2025-04-18  7:00                         ` Thomas Gleixner
2025-04-19  5:55                           ` John Stultz
2025-04-18 18:40                         ` John Stultz
2025-04-19  5:46                           ` [PATCH v3] " John Stultz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Z-5HlSUEh1xgCi4f@localhost \
    --to=mlichvar@redhat.com \
    --cc=anna-maria@linutronix.de \
    --cc=frederic@kernel.org \
    --cc=jstultz@google.com \
    --cc=kernel-team@android.com \
    --cc=lei.chen@smartx.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=sboyd@kernel.org \
    --cc=shuah@kernel.org \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).