[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <87ttena56d.ffs@tglx>
Date: Tue, 10 Sep 2024 17:39:54 +0200
From: Thomas Gleixner <tglx@...utronix.de>
To: Jeff Layton <jlayton@...nel.org>, John Stultz <jstultz@...gle.com>,
Stephen Boyd <sboyd@...nel.org>
Cc: Vadim Fedorenko <vadim.fedorenko@...ux.dev>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH RFC] timekeeping: don't use seqcount loop in
ktime_mono_to_any on 64-bit arch
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
Powered by blists - more mailing lists