From: Rik van Riel <riel@surriel.com>
To: neeraj.upadhyay@kernel.org, linux-kernel@vger.kernel.org
Cc: rcu@vger.kernel.org, kernel-team@meta.com, rostedt@goodmis.org,
mingo@kernel.org, peterz@infradead.org, paulmck@kernel.org,
leobras@redhat.com, imran.f.khan@oracle.com
Subject: Re: [PATCH 1/3] locking/csd_lock: Print large numbers as negatives
Date: Sat, 13 Jul 2024 13:14:27 -0400 [thread overview]
Message-ID: <8975d74f5807f76478ed08206dd5eda133a55bb0.camel@surriel.com> (raw)
In-Reply-To: <20240713165846.216174-1-neeraj.upadhyay@kernel.org>
On Sat, 2024-07-13 at 22:28 +0530, neeraj.upadhyay@kernel.org wrote:
> From: "Paul E. McKenney" <paulmck@kernel.org>
>
> The CSD-lock-hold diagnostics from CONFIG_CSD_LOCK_WAIT_DEBUG are
> printed in nanoseconds as unsigned long longs, which is a bit obtuse
> for
> human readers when timing bugs result in negative CSD-lock hold
> times.
> Yes, there are some people to whom it is immediately obvious that
> 18446744073709551615 is really -1, but for the rest of us...
>
To clarify the report a little bit: it appears that, on some CPU
models, occasionally sched_clock() values jump backward, on the
same CPU.
Looking at the number of systems where this happened over time,
leaving out the exact numbers, the distribution looks something
like this:
- 1 day: N systems
- 3 days: 3N systems
- 1 week: 7N systems
- 1 month: 26N systems
- 90 days: 72N systems
This does not appear to be a case of a few systems with bad
hardware, where it happens constantly to the same systems, but
something that many systems experience occasionally, and then
not again for months.
The systems in question advertise CONSTANT_TSC, NONSTOP_TSC,
and generally seem to have stable, nonstop, monotonic TSC
values, but sometimes the values go back in time a little bit.
The cycles_2_ns data does not appear to change during the
episodes of sched_clock() going backward.
The csd_lock code is not the only thing that breaks when the
sched_clock values go backward, but it seems to be the best thing
we seem to have right now to detect it.
I don't know whether adding more detection of this issue would
increase the number of systems where backwards sched_clock is
observed.
Many of the systems with backwards going TSC values seem to
encounter a bunch of them across some time period, end up
getting rebooted, and then behave well for months after.
> Reported-by: Rik van Riel <riel@surriel.com>
> Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
> Cc: Imran Khan <imran.f.khan@oracle.com>
> Cc: Ingo Molnar <mingo@kernel.org>
> Cc: Leonardo Bras <leobras@redhat.com>
> Cc: "Peter Zijlstra (Intel)" <peterz@infradead.org>
> Cc: Rik van Riel <riel@surriel.com>
> Signed-off-by: Neeraj Upadhyay <neeraj.upadhyay@kernel.org>
>
Reviewed-by: Rik van Riel <riel@surriel.com>
--
All Rights Reversed.
next prev parent reply other threads:[~2024-07-13 17:19 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-13 16:56 [PATCH 0/3] CSD-lock diagnostics enhancements Neeraj Upadhyay
2024-07-13 16:58 ` [PATCH 1/3] locking/csd_lock: Print large numbers as negatives neeraj.upadhyay
2024-07-13 17:14 ` Rik van Riel [this message]
2024-07-13 16:58 ` [PATCH 2/3] locking/csd_lock: Provide an indication of ongoing CSD-lock stall neeraj.upadhyay
2024-07-13 17:16 ` Rik van Riel
2024-07-13 19:32 ` Paul E. McKenney
2024-07-13 16:58 ` [PATCH 3/3] locking/csd-lock: Use backoff for repeated reports of same incident neeraj.upadhyay
2024-07-14 0:59 ` Rik van Riel
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=8975d74f5807f76478ed08206dd5eda133a55bb0.camel@surriel.com \
--to=riel@surriel.com \
--cc=imran.f.khan@oracle.com \
--cc=kernel-team@meta.com \
--cc=leobras@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=neeraj.upadhyay@kernel.org \
--cc=paulmck@kernel.org \
--cc=peterz@infradead.org \
--cc=rcu@vger.kernel.org \
--cc=rostedt@goodmis.org \
/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
all inboxes | Powered by JetHome®