The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@kernel.org>
To: Dmitry Ilvokhin <d@ilvokhin.com>, Usama Arif <usama.arif@linux.dev>
Cc: lkmm@lists.linux.dev, joelagnelf@nvidia.com,
	linux-kernel@vger.kernel.org, marco.crivellari@suse.com,
	paulmck@kernel.org, rafael.j.wysocki@intel.com,
	rdunlap@infradead.org, riel@surriel.com, sshegde@linux.ibm.com,
	ulfh@kernel.org, yury.norov@gmail.com, rcu@vger.kernel.org,
	shakeel.butt@linux.dev, hannes@cmpxchg.org, kernel-team@meta.com
Subject: Re: [PATCH v2] smp: Use release stores for csd_lock_record() state
Date: Fri, 26 Jun 2026 21:20:35 +0200	[thread overview]
Message-ID: <877bnlhzwc.ffs@fw13> (raw)
In-Reply-To: <aj6stbjxAfjMaCUm@shell.ilvokhin.com>

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

  reply	other threads:[~2026-06-26 19:20 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-22 16:38 [PATCH v2] smp: Use release stores for csd_lock_record() state Usama Arif
2026-06-24 14:15 ` Kunwu Chan
2026-06-24 15:27   ` Usama Arif
2026-06-25 14:42 ` Dmitry Ilvokhin
2026-06-26 16:30   ` Usama Arif
2026-06-26 16:45     ` Dmitry Ilvokhin
2026-06-26 19:20       ` Thomas Gleixner [this message]
2026-06-26 19:25 ` Thomas Gleixner

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=877bnlhzwc.ffs@fw13 \
    --to=tglx@kernel.org \
    --cc=d@ilvokhin.com \
    --cc=hannes@cmpxchg.org \
    --cc=joelagnelf@nvidia.com \
    --cc=kernel-team@meta.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkmm@lists.linux.dev \
    --cc=marco.crivellari@suse.com \
    --cc=paulmck@kernel.org \
    --cc=rafael.j.wysocki@intel.com \
    --cc=rcu@vger.kernel.org \
    --cc=rdunlap@infradead.org \
    --cc=riel@surriel.com \
    --cc=shakeel.butt@linux.dev \
    --cc=sshegde@linux.ibm.com \
    --cc=ulfh@kernel.org \
    --cc=usama.arif@linux.dev \
    --cc=yury.norov@gmail.com \
    /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