Netdev List
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Shivaji Kant <shivajikant@google.com>
Cc: netdev@vger.kernel.org, praan@google.com,
	Mina Almasry <almasrymina@google.com>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Paolo Abeni <pabeni@redhat.com>, Simon Horman <horms@kernel.org>,
	Bobby Eshleman <bobbyeshleman@meta.com>,
	Stanislav Fomichev <sdf@fomichev.me>,
	Dragos Tatulea <dtatulea@nvidia.com>, Kees Cook <kees@kernel.org>,
	David Carlier <devnexen@gmail.com>,
	Yue Haibing <yuehaibing@huawei.com>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Nikolay Aleksandrov <razor@blackwall.org>,
	David Wei <dw@davidwei.uk>, Maoyi Xie <maoyixie.tju@gmail.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next v2] net: convert netdev_nl_sock bindings list to xarray
Date: Fri, 14 Aug 2026 06:50:54 -0700	[thread overview]
Message-ID: <20260814065054.55333a89@kernel.org> (raw)
In-Reply-To: <CAMEhMpmq7ZrW+4Q19gsF9k3v6S90k61oEXB6t4Oc4d9EU_QAbw@mail.gmail.com>

On Fri, 14 Aug 2026 12:04:59 +0530 Shivaji Kant wrote:
> I understand, my thinking for this was removing priv->lock is more
> than just simplification, it can be a concurrency win. Sorry for not
> making it more explicit in the patch description.
> As you pointed out, priv->lock current serializes the entire doit
> block (including netdev_get_by_index_lock() and the entire
> net_devmem_bind_dmabuf_to_queue() loop). Furthermore,
> net_devmem_unbind_dmabuf() blocks on synchronize_net(). With the
> current mutex implementation, if one thread is destroying a socket or
> unbinding a dmabuf, it holds priv->lock across synchronize_net(),
> completely blocking any concurrent netlink commands on the same socket
> (e.g., binding to a different queue/interface).
> Converting to an xarray allows us to cleanly dissolve this wide
> serialization scope. xa_for_each() handles the RCU grace periods
> internally without holding a manual lock across synchronize_net(). I
> agree the changelog must be updated to clearly state that reducing
> this serialization scope is the explicit goal.

If it's an optimization you have to show prod data (as in not a micro
benchmark) that the problem actually exists.

And please describe how your application manages the sockets, we're
talking about a lock on a management socket, not some global lock
blocking the whole system.

  reply	other threads:[~2026-08-14 13:50 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-11 14:29 [PATCH net-next v2] net: convert netdev_nl_sock bindings list to xarray Shivaji Kant
2026-08-12 14:30 ` Nikolay Aleksandrov
2026-08-13  0:28 ` Jakub Kicinski
2026-08-14  6:34   ` Shivaji Kant
2026-08-14 13:50     ` Jakub Kicinski [this message]
2026-08-14 16:07       ` Mina Almasry
2026-08-13  0:28 ` Jakub Kicinski
2026-08-14  6:49   ` Shivaji Kant

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=20260814065054.55333a89@kernel.org \
    --to=kuba@kernel.org \
    --cc=almasrymina@google.com \
    --cc=bobbyeshleman@meta.com \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=devnexen@gmail.com \
    --cc=dtatulea@nvidia.com \
    --cc=dw@davidwei.uk \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=kees@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maoyixie.tju@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=praan@google.com \
    --cc=razor@blackwall.org \
    --cc=sdf@fomichev.me \
    --cc=shivajikant@google.com \
    --cc=yuehaibing@huawei.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