From: Jakub Kicinski <kuba@kernel.org>
To: Herbert Xu <herbert@gondor.apana.org.au>
Cc: Alexander Duyck <alexander.duyck@gmail.com>,
Heiner Kallweit <hkallweit1@gmail.com>,
davem@davemloft.net, netdev@vger.kernel.org, edumazet@google.com,
pabeni@redhat.com
Subject: Re: [PATCH net-next 1/3] net: provide macros for commonly copied lockless queue stop/wake code
Date: Tue, 4 Apr 2023 15:36:55 -0700 [thread overview]
Message-ID: <20230404153655.5be6f1a8@kernel.org> (raw)
In-Reply-To: <ZCvGDxW+HkcHYaU/@gondor.apana.org.au>
On Tue, 4 Apr 2023 14:39:11 +0800 Herbert Xu wrote:
> Thanks for adding me to this thread as otherwise I would've surely
> missed it.
>
> I see where the confusion is coming from. The key is that we weren't
> trying to stop every single race, because not all of them are fatal.
>
> In particular, we tolerate the race where a wake is done when it
> shouldn't be because the network stack copes with that by requeueing
> the skb onto the qdisc.
>
> So it's a trade-off. We could make our code water-tight, but then
> we would be incurring a penalty for every skb. With our current
> approach, the penalty is only incurred in the unlikely event of a
> race which results in the unlucky skb being requeued.
>
> The race that we do want to stop is a queue being stuck in a stopped
> state when it shouldn't because that indeed is fatal.
>
> Going back to the proposed helpers, we only need one mb because
> that's all we need to fix the stuck/stopped queue race.
Thanks, I'm impressed you still remember the details :)
I'll leave it racy in the next version. Re-using the BQL barrier
is a bit more tricky on the xmit path than I thought. I'll just
document that false-positive wake ups are possible.
next prev parent reply other threads:[~2023-04-04 22:37 UTC|newest]
Thread overview: 44+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-01 5:12 [PATCH net-next 0/3] net: provide macros for commonly copied lockless queue stop/wake code Jakub Kicinski
2023-04-01 5:12 ` [PATCH net-next 1/3] " Jakub Kicinski
2023-04-01 15:04 ` Heiner Kallweit
2023-04-01 18:03 ` Jakub Kicinski
2023-04-01 15:18 ` Heiner Kallweit
2023-04-01 18:58 ` Jakub Kicinski
2023-04-01 20:41 ` Heiner Kallweit
2023-04-03 15:18 ` Alexander Duyck
2023-04-03 15:56 ` Jakub Kicinski
2023-04-03 18:11 ` Alexander Duyck
2023-04-03 19:03 ` Jakub Kicinski
2023-04-03 20:27 ` Alexander Duyck
2023-04-05 22:20 ` Paul E. McKenney
2023-04-06 5:15 ` Herbert Xu
2023-04-06 14:17 ` Paul E. McKenney
2023-04-06 14:46 ` Jakub Kicinski
2023-04-06 15:45 ` Paul E. McKenney
2023-04-06 15:56 ` Jakub Kicinski
2023-04-06 16:25 ` Paul E. McKenney
2023-04-07 0:58 ` Herbert Xu
2023-04-07 1:03 ` Jakub Kicinski
2023-04-07 1:14 ` Herbert Xu
2023-04-07 1:21 ` Jakub Kicinski
2023-04-04 6:39 ` Herbert Xu
2023-04-04 22:36 ` Jakub Kicinski [this message]
2023-04-01 5:12 ` [PATCH net-next 2/3] ixgbe: use new queue try_stop/try_wake macros Jakub Kicinski
2023-04-01 5:12 ` [PATCH net-next 3/3] bnxt: " Jakub Kicinski
2023-04-01 18:35 ` Michael Chan
-- strict thread matches above, loose matches on Subject: below --
2023-03-22 23:30 [PATCH net-next 1/3] net: provide macros for commonly copied lockless queue stop/wake code Jakub Kicinski
2023-03-23 0:35 ` Andrew Lunn
2023-03-23 1:04 ` Jakub Kicinski
2023-03-23 21:02 ` Andrew Lunn
2023-03-23 22:46 ` Jakub Kicinski
2023-03-23 3:05 ` Yunsheng Lin
2023-03-23 3:27 ` Jakub Kicinski
2023-03-23 4:53 ` Pavan Chebbi
2023-03-23 5:08 ` Jakub Kicinski
2023-03-23 16:05 ` Alexander H Duyck
2023-03-24 3:09 ` Jakub Kicinski
2023-03-24 15:45 ` Alexander Duyck
2023-03-24 21:28 ` Jakub Kicinski
2023-03-26 21:23 ` Alexander Duyck
2023-03-29 0:56 ` Jakub Kicinski
2023-03-30 14:56 ` Paolo Abeni
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=20230404153655.5be6f1a8@kernel.org \
--to=kuba@kernel.org \
--cc=alexander.duyck@gmail.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=herbert@gondor.apana.org.au \
--cc=hkallweit1@gmail.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;
as well as URLs for NNTP newsgroup(s).