From: Jakub Kicinski <kuba@kernel.org>
To: Edward Cree <ecree.xilinx@gmail.com>
Cc: Gui-Dong Han <hanguidong02@gmail.com>,
netdev@vger.kernel.org, linux-net-drivers@amd.com,
linux-kernel@vger.kernel.org, andrew+netdev@lunn.ch,
davem@davemloft.net, edumazet@google.com, pabeni@redhat.com,
baijiaju1990@gmail.com
Subject: Re: [PATCH] sfc: Use acquire/release for irq_soft_enabled
Date: Wed, 3 Jun 2026 16:52:38 -0700 [thread overview]
Message-ID: <20260603165238.43259251@kernel.org> (raw)
In-Reply-To: <74e6932f-a755-4931-8d4d-0025826a5502@gmail.com>
On Wed, 3 Jun 2026 21:28:02 +0100 Edward Cree wrote:
> On 03/06/2026 19:20, Jakub Kicinski wrote:
> > On Thu, 28 May 2026 17:28:38 +0800 Gui-Dong Han wrote:
> >> Use release stores when updating the gate and acquire loads in interrupt
> >> handlers before touching channels. Keep the existing smp_wmb() after gate
> >> updates, preserving the current ordering with event queue start and stop.
> >
> > Why are you keeping the smp_wmb() tho? You don't have to repeat what
> > the patch does. The goal of the commit message is to explain the why.
> >
> > Ed, WDYT?
>
> I think... that my head hurts from trying to understand this.
> What I particularly don't understand is why it wouldn't suffice to just
> put smp_rmb() after every read of irq_soft_enabled, pairing with the
> existing smp_wmb().
Exactly..
> And, conversely, why any of this works at all — what stops an interrupt
> handler passing the gate, because the write to irq_soft_enabled has
> propagated to its CPU, but the writes to channel pointers haven't?
> Naïvely I'd expect the smp_wmb() in efx_soft_enable_interrupts() to
> come _before_ the write to irq_soft_enabled.
> (The smp_wmb() in efx_soft_disable_interrupts(), I'm not sure exactly
> what that pairs with, since the ordering that matters there is between
> the irq_soft_enabled=false write and the synchronize_irq().)
>
> Anyway, this code predates my involvement with sfc and I've never had
> to touch it, so frankly I don't know any more here than anyone else,
> and if a memory-models expert reviews it and says 'this is needed and
> correct', that would mean more than a review tag from me.
> That's not a cop-out "I won't review this", rather I'm saying that if
> Gui-Dong can't convince me because I'm too dumb, but can convince you,
> then you don't need to wait for me to show up and add my tag.
I haven't dug into the code too much but FWIW having a store_release
barrier which flips something _both_ to true and false strikes me as
highly suspicious. So the patch needs a much better commit description
at the very least.
Thanks for the prompt reply!
next prev parent reply other threads:[~2026-06-03 23:52 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-28 9:28 [PATCH] sfc: Use acquire/release for irq_soft_enabled Gui-Dong Han
2026-06-03 12:06 ` Simon Horman
2026-06-03 12:47 ` Gui-Dong Han
2026-06-03 18:20 ` Jakub Kicinski
2026-06-03 20:28 ` Edward Cree
2026-06-03 23:52 ` Jakub Kicinski [this message]
2026-06-04 2:17 ` Gui-Dong Han
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=20260603165238.43259251@kernel.org \
--to=kuba@kernel.org \
--cc=andrew+netdev@lunn.ch \
--cc=baijiaju1990@gmail.com \
--cc=davem@davemloft.net \
--cc=ecree.xilinx@gmail.com \
--cc=edumazet@google.com \
--cc=hanguidong02@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-net-drivers@amd.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.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