All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Horman <horms@kernel.org>
To: Kuniyuki Iwashima <kuniyu@amazon.com>
Cc: "David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Andy Whitcroft <apw@canonical.com>, Joe Perches <joe@perches.com>,
	Dwaipayan Ray <dwaipayanray1@gmail.com>,
	Lukas Bulwahn <lukas.bulwahn@gmail.com>,
	Kuniyuki Iwashima <kuni1840@gmail.com>,
	netdev@vger.kernel.org
Subject: Re: [PATCH v1 net-next] checkpatch: Discourage a new use of rtnl_lock() variants.
Date: Wed, 12 Feb 2025 18:23:30 +0000	[thread overview]
Message-ID: <20250212182330.GI1615191@kernel.org> (raw)
In-Reply-To: <20250211070447.25001-1-kuniyu@amazon.com>

On Tue, Feb 11, 2025 at 04:04:47PM +0900, Kuniyuki Iwashima wrote:
> rtnl_lock() is a "Big Kernel Lock" in the networking slow path
> and still serialises most of RTM_(NEW|DEL|SET)* rtnetlink requests.
> 
> Commit 76aed95319da ("rtnetlink: Add per-netns RTNL.") started a
> very large, in-progress, effort to make the RTNL lock scope per
> network namespace.
> 
> However, there are still some patches that newly use rtnl_lock(),
> which is now discouraged, and we need to revisit it later.
> 
> Let's warn about the case by checkpatch.
> 
> The target functions are as follows:
> 
>   * rtnl_lock()
>   * rtnl_trylock()
>   * rtnl_lock_interruptible()
>   * rtnl_lock_killable()
> 
> and the warning will be like:
> 
>   WARNING: A new use of rtnl_lock() variants is discouraged, try to use rtnl_net_lock(net) variants
>   #18: FILE: net/core/rtnetlink.c:79:
>   +	rtnl_lock();
> 
> Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.com>
> ---
> It would be nice if this patch goes through net-next.git to catch
> new rtnl_lock() users by netdev CI.

Reviewed-by: Simon Horman <horms@kernel.org>


  reply	other threads:[~2025-02-12 18:23 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-11  7:04 [PATCH v1 net-next] checkpatch: Discourage a new use of rtnl_lock() variants Kuniyuki Iwashima
2025-02-12 18:23 ` Simon Horman [this message]
2025-02-13 11:03 ` Paolo Abeni
2025-02-13 12:10   ` Kuniyuki Iwashima
2025-02-13 12:18     ` Kuniyuki Iwashima

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=20250212182330.GI1615191@kernel.org \
    --to=horms@kernel.org \
    --cc=apw@canonical.com \
    --cc=davem@davemloft.net \
    --cc=dwaipayanray1@gmail.com \
    --cc=edumazet@google.com \
    --cc=joe@perches.com \
    --cc=kuba@kernel.org \
    --cc=kuni1840@gmail.com \
    --cc=kuniyu@amazon.com \
    --cc=lukas.bulwahn@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.