Re: [PATCH v2] smp: Use release stores for csd_lock_record() state

From: Thomas Gleixner

Date: Fri Jun 26 2026 - 15:20:42 EST


On Fri, Jun 26 2026 at 16:45, Dmitry Ilvokhin wrote:
> On Fri, Jun 26, 2026 at 05:30:21PM +0100, Usama Arif wrote:
>> > Since v2 is specifically about documenting the pairing, it would be good
>> > to make it symmetric and add the comment on the acquire side in
>> > csd_lock_wait_toolong().
>> >
>>
>> Its already documented [1]
>>
>> [1] https://elixir.bootlin.com/linux/v7.1.1/source/kernel/smp.c#L275

Can you please avoid these silly links to a random source tree and just
tell people kernel/smp.c line 275?

> It is documented to some extent, but it doesn't explicitly state which
> smp_store_release() the smp_load_acquire() pairs with. I think that's
> the main benefit of these comments: making the synchronization pair
> explicit so readers don't have to infer it.

It's mandatory according to Documentation:

"Certain things should always be commented. Uses of memory barriers should
be accompanied by a line explaining why the barrier is necessary"

which means it needs to be at the place where the barrier is used and
that implies an explanation for the pairing. It's a pain having to do
detective work to figure it out.

Thanks,

tglx