public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Feng Tang <feng.tang@intel.com>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: "Paul E. McKenney" <paulmck@kernel.org>,
	<linux-kernel@vger.kernel.org>, <john.stultz@linaro.org>,
	<sboyd@kernel.org>, <corbet@lwn.net>, <Mark.Rutland@arm.com>,
	<maz@kernel.org>, <kernel-team@meta.com>,
	<neeraju@codeaurora.org>, <ak@linux.intel.com>,
	<zhengjun.xing@intel.com>, Waiman Long <longman@redhat.com>,
	John Stultz <jstultz@google.com>
Subject: Re: [PATCH clocksource 5/6] clocksource: Suspend the watchdog temporarily when high read latency detected
Date: Wed, 11 Jan 2023 20:31:58 +0800	[thread overview]
Message-ID: <Y76sPnnX/73LuGez@feng-clx> (raw)
In-Reply-To: <87r0w1ia65.ffs@tglx>

On Wed, Jan 11, 2023 at 12:26:58PM +0100, Thomas Gleixner wrote:
> On Wed, Jan 04 2023 at 17:07, Paul E. McKenney wrote:
> > This can be reproduced by running memory intensive 'stream' tests,
> > or some of the stress-ng subcases such as 'ioport'.
> >
> > The reason for these issues is the when system is under heavy load, the
> > read latency of the clocksources can be very high.  Even lightweight TSC
> > reads can show high latencies, and latencies are much worse for external
> > clocksources such as HPET or the APIC PM timer.  These latencies can
> > result in false-positive clocksource-unstable determinations.
> >
> > Given that the clocksource watchdog is a continual diagnostic check with
> > frequency of twice a second, there is no need to rush it when the system
> > is under heavy load.  Therefore, when high clocksource read latencies
> > are detected, suspend the watchdog timer for 5 minutes.
> 
> We should have enough heuristics in place by now to qualify the output of
> the clocksource watchdog as a random number generator, right?

The issue was found on a 8 sockets machine (around 400 cores, 800 CPUs),
and seems with the bigger and bigger CPU numbers, the spark latency
of reading HPET or even TSC is very high, which does affect the
accuracy of clocksource watchdog check. And unfortunately, we can't
just disable the watchdog for these 8 sockets machine.

We tried a debug patch which disables interrupt and does consective
reads with 'rdtsc', and check the delta between these reads (when
system is running some heavy load), sometimes we can see up to
300 micro-seconds delta, on a 2-sockets Icelake machine. Similar
thing if we replace the 'rdtsc' with 'rdtscp' or 'lfence;rdtsc'.
And I was told the max latency is much higher on the 8 sockets
machine.

Thanks,
Feng



  reply	other threads:[~2023-01-11 12:34 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-05  1:04 [PATCH clocksource 0/6] Clocksource watchdog updates for v6.3 Paul E. McKenney
2023-01-05  1:06 ` [PATCH clocksource 1/6] clocksource: Print clocksource name when clocksource is tested unstable Paul E. McKenney
2023-01-05  1:06 ` [PATCH clocksource 2/6] clocksource: Loosen clocksource watchdog constraints Paul E. McKenney
2023-01-05  1:06 ` [PATCH clocksource 3/6] clocksource: Improve read-back-delay message Paul E. McKenney
2023-01-05  1:06 ` [PATCH clocksource 4/6] clocksource: Improve "skew is too large" messages Paul E. McKenney
2023-01-05  1:07 ` [PATCH clocksource 5/6] clocksource: Suspend the watchdog temporarily when high read latency detected Paul E. McKenney
2023-01-11 11:26   ` Thomas Gleixner
2023-01-11 12:31     ` Feng Tang [this message]
2023-01-11 17:50     ` Paul E. McKenney
2023-01-11 21:19       ` Thomas Gleixner
2023-01-11 21:32         ` Paul E. McKenney
2023-01-12  0:59           ` Feng Tang
2023-01-05  1:07 ` [PATCH clocksource 6/6] clocksource: Verify HPET and PMTMR when TSC unverified Paul E. McKenney

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=Y76sPnnX/73LuGez@feng-clx \
    --to=feng.tang@intel.com \
    --cc=Mark.Rutland@arm.com \
    --cc=ak@linux.intel.com \
    --cc=corbet@lwn.net \
    --cc=john.stultz@linaro.org \
    --cc=jstultz@google.com \
    --cc=kernel-team@meta.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=longman@redhat.com \
    --cc=maz@kernel.org \
    --cc=neeraju@codeaurora.org \
    --cc=paulmck@kernel.org \
    --cc=sboyd@kernel.org \
    --cc=tglx@linutronix.de \
    --cc=zhengjun.xing@intel.com \
    /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