public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: Jeff Layton <jlayton@kernel.org>,
	John Stultz <jstultz@google.com>, Stephen Boyd <sboyd@kernel.org>
Cc: Vadim Fedorenko <vadim.fedorenko@linux.dev>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH RFC] timekeeping: don't use seqcount loop in ktime_mono_to_any on 64-bit arch
Date: Tue, 10 Sep 2024 17:39:54 +0200	[thread overview]
Message-ID: <87ttena56d.ffs@tglx> (raw)
In-Reply-To: <ee39e467d23070c00aa39f12895fe346406f527f.camel@kernel.org>

On Tue, Sep 10 2024 at 08:32, Jeff Layton wrote:
> On Tue, 2024-09-10 at 13:58 +0200, Thomas Gleixner wrote:
>> > +#if BITS_PER_LONG == 64
>> > +ktime_t ktime_mono_to_any(ktime_t tmono, enum tk_offsets offs)
>> > +{
>> > +	ktime_t *offset = offsets[offs];
>> > +
>> > +	return ktime_add(tmono, READ_ONCE(*offset));
>> 
>> Where is the corresponing WRITE_ONCE()?
>> 
> I'll just make it do a simple fetch without READ_ONCE.

Which will make KCSAN complain ...

So yes, READ_ONCE() is the correct thing todo, but then we want to have
the counterpart at the write sides.

Thanks,

        tglx

      reply	other threads:[~2024-09-10 15:39 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-10 11:17 [PATCH RFC] timekeeping: don't use seqcount loop in ktime_mono_to_any on 64-bit arch Jeff Layton
2024-09-10 11:58 ` Thomas Gleixner
2024-09-10 12:32   ` Jeff Layton
2024-09-10 15:39     ` Thomas Gleixner [this message]

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=87ttena56d.ffs@tglx \
    --to=tglx@linutronix.de \
    --cc=jlayton@kernel.org \
    --cc=jstultz@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sboyd@kernel.org \
    --cc=vadim.fedorenko@linux.dev \
    /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