mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Edward Cree <ecree.xilinx@gmail.com>
To: Jakub Kicinski <kuba@kernel.org>, Gui-Dong Han <hanguidong02@gmail.com>
Cc: 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 21:28:02 +0100	[thread overview]
Message-ID: <74e6932f-a755-4931-8d4d-0025826a5502@gmail.com> (raw)
In-Reply-To: <20260603112035.0866d7d4@kernel.org>

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().
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.

-ed

  reply	other threads:[~2026-06-03 20:28 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-28  9:28 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 [this message]
2026-06-03 23:52     ` Jakub Kicinski
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=74e6932f-a755-4931-8d4d-0025826a5502@gmail.com \
    --to=ecree.xilinx@gmail.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=baijiaju1990@gmail.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=hanguidong02@gmail.com \
    --cc=kuba@kernel.org \
    --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

Powered by JetHome