From: Wang Zhan <wang.zhan@smartx.com>
To: netdev@vger.kernel.org
Cc: davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
pabeni@redhat.com, horms@kernel.org, keyong.sun@smartx.com,
Wang Zhan <wang.zhan@smartx.com>
Subject: [PATCH net-next v2 0/2] net: sysfs: use ops lock for speed and duplex
Date: Thu, 3 Sep 2026 21:33:12 +0800 [thread overview]
Message-ID: <20260903133314.3703381-1-wang.zhan@smartx.com> (raw)
Reading speed and duplex from sysfs currently holds RTNL across the
get_link_ksettings callback. This unnecessarily serializes monitoring
reads with unrelated rtnetlink operations.
On CPU-throttled hosts, a periodic reader such as node-exporter can hold
RTNL for hundreds of milliseconds while an mlx5 callback runs, delaying
unrelated rtnetlink operations.
Factor the shared link settings read first, then change only the helper's
locking. Legacy devices and callbacks which request
ETHTOOL_OP_NEEDS_RTNL_LINKSETTINGS retain the existing RTNL path.
Changes in v2:
- Split the common-code refactoring from the locking change.
- Keep speed_show() and duplex_show() focused on formatting the result.
v1: https://lore.kernel.org/netdev/20260831080623.1064001-1-wang.zhan@smartx.com/
Checks:
- checkpatch.pl --strict
- git diff --check
- x86_64 defconfig W=1 net/core/net-sysfs.o
Wang Zhan (2):
net: sysfs: factor out link settings read
net: sysfs: use ops lock for speed and duplex
net/core/net-sysfs.c | 112 ++++++++++++++++++++++++-------------------
1 file changed, 63 insertions(+), 49 deletions(-)
base-commit: b35d3d2fae3058265ba937544a3895cedce18d08
--
2.47.3
next reply other threads:[~2026-09-03 13:33 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-03 13:33 Wang Zhan [this message]
2026-09-03 13:33 ` [PATCH net-next v2 1/2] net: sysfs: factor out link settings read Wang Zhan
2026-09-03 13:33 ` [PATCH net-next v2 2/2] net: sysfs: use ops lock for speed and duplex Wang Zhan
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=20260903133314.3703381-1-wang.zhan@smartx.com \
--to=wang.zhan@smartx.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=keyong.sun@smartx.com \
--cc=kuba@kernel.org \
--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