mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Rik van Riel <riel@surriel.com>
To: paulmck@kernel.org, linux-kernel@vger.kernel.org
Cc: neeraj.upadhyay@kernel.org, leobras@redhat.com,
	tglx@linutronix.de,  peterz@infradead.org, qiyuzhu2@amd.com
Subject: Re: locking/csd-lock: Switch from sched_clock() to ktime_get_mono_fast_ns()
Date: Thu, 10 Oct 2024 11:13:35 -0400	[thread overview]
Message-ID: <9ca16991fa83fb7c7baeee153666d70717be2b7a.camel@surriel.com> (raw)
In-Reply-To: <da9e8bee-71c2-4a59-a865-3dd6c5c9f092@paulmck-laptop>

On Wed, 2024-10-09 at 10:57 -0700, Paul E. McKenney wrote:
> Currently, the CONFIG_CSD_LOCK_WAIT_DEBUG code uses sched_clock()
> to check for excessive CSD-lock wait times.  This works, but does not
> guarantee monotonic timestamps.  Therefore, switch from sched_clock()
> to ktime_get_mono_fast_ns(), which does guarantee monotonic
> timestamps,
> at least in the absence of calls from NMI handlers, which are not
> involved
> in this code path.
> 
> Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
> Cc: Neeraj Upadhyay <neeraj.upadhyay@kernel.org>
> Cc: Rik van Riel <riel@surriel.com>
> Cc: Leonardo Bras <leobras@redhat.com>
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Cc: "Peter Zijlstra (Intel)" <peterz@infradead.org>

The functional change here is that sched_clock() uses rdtsc(),
while ktime_get_mono_fast_ns() uses rdtsc_ordered().

I don't know if sched_clock() should also be using rdtsc_ordered().

Reviewed-by: Rik van Riel <riel@surriel.com>


-- 
All Rights Reversed.

  parent reply	other threads:[~2024-10-10 15:14 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-09 17:57 Paul E. McKenney
2024-10-09 18:07 ` Peter Zijlstra
2024-10-09 18:18   ` Paul E. McKenney
2024-10-10 11:21     ` Peter Zijlstra
2024-10-10 14:13       ` Paul E. McKenney
2024-10-10 15:13 ` Rik van Riel [this message]
2024-10-10 18:31   ` Paul E. McKenney
2024-10-11 17:40     ` 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=9ca16991fa83fb7c7baeee153666d70717be2b7a.camel@surriel.com \
    --to=riel@surriel.com \
    --cc=leobras@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=neeraj.upadhyay@kernel.org \
    --cc=paulmck@kernel.org \
    --cc=peterz@infradead.org \
    --cc=qiyuzhu2@amd.com \
    --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

all inboxes | Powered by JetHome®