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

Thomas Gleixner <[email protected]>
Newsgroups org.kernel.vger.rcu,dev.linux.lists.lkmm,org.kernel.vger.linux-kernel
Message-ID <877bnlhzwc.ffs@fw13>
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.