Linux Documentation
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Paolo Abeni <pabeni@redhat.com>
Cc: netdev@vger.kernel.org, edumazet@google.com,
	andrew+netdev@lunn.ch, horms@kernel.org, corbet@lwn.net,
	skhan@linuxfoundation.org, rdunlap@infradead.org,
	sdf@fomichev.me, kuniyu@google.com, linux-doc@vger.kernel.org,
	davem@davemloft.net
Subject: Re: [PATCH net-next] net: run netdev work under the ops-compat lock
Date: Wed, 9 Sep 2026 18:22:15 -0700	[thread overview]
Message-ID: <20260909182215.14b5d94d@kernel.org> (raw)
In-Reply-To: <3e210ef7-f807-4de7-935d-09441710acbd@redhat.com>

Oops, looks like this has been sitting in my outbox for some reason

On Tue, 8 Sep 2026 13:26:52 +0200 Paolo Abeni wrote:
> On 9/4/26 8:00 PM, Jakub Kicinski wrote:
> > netdev_work_proc() took rtnl_lock() for the whole batch, forcing
> > even ops-locked drivers onto rtnl just to run their rx_mode / ndo_work
> > callbacks. Take the per-device ops-compat lock instead: the instance
> > lock for ops-locked drivers, rtnl_lock for the rest. That's what the
> > callbacks already assert (e.g. netif_rx_mode_run() asserts
> > netdev_assert_locked_ops_compat()), and non-ops-locked work
> > such as vlan ndo_work keeps rtnl, since its compat lock resolves
> > to rtnl anyway.
> > 
> > Without this adding more uses of ndo_work, for cases which don't
> > need rtnl_lock feels like a step back.
> > 
> > We can drop the comment about the extra ref now, with the relocking
> > it's a necessity.
> > 
> > Signed-off-by: Jakub Kicinski <kuba@kernel.org>  
> Dump question: can the `netdev_work_list` work list grow significantly
> under non pathological conditions? netdev_work_proc is now going to
> acquire and release the rtnl lock n-times for non ops-enabled drivers.
> 
> Would it be overkill trying to acquire the rtnl lock at most once (i.e.
> keeping the netdev_need_ops_lock() and legacy drivers on separate list
> and process them accordingly?)

I haven't seen any evidence of such relocking causing issues so I didn't
want to complicate the code. We have a similar situation in a number of
netdev genetlink dump handlers.

  reply	other threads:[~2026-09-10  1:22 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-04 18:00 [PATCH net-next] net: run netdev work under the ops-compat lock Jakub Kicinski
2026-09-08 11:26 ` Paolo Abeni
2026-09-10  1:22   ` Jakub Kicinski [this message]
2026-09-10  6:31     ` Paolo Abeni
2026-09-10  8:00 ` patchwork-bot+netdevbpf

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=20260909182215.14b5d94d@kernel.org \
    --to=kuba@kernel.org \
    --cc=andrew+netdev@lunn.ch \
    --cc=corbet@lwn.net \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=kuniyu@google.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=rdunlap@infradead.org \
    --cc=sdf@fomichev.me \
    --cc=skhan@linuxfoundation.org \
    /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