Netdev List
 help / color / mirror / Atom feed
* [PATCH net-next v2 0/2] net: sysfs: use ops lock for speed and duplex
@ 2026-09-03 13:33 Wang Zhan
  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
  0 siblings, 2 replies; 3+ messages in thread
From: Wang Zhan @ 2026-09-03 13:33 UTC (permalink / raw)
  To: netdev; +Cc: davem, edumazet, kuba, pabeni, horms, keyong.sun, Wang Zhan

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-09-03 13:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-03 13:33 [PATCH net-next v2 0/2] net: sysfs: use ops lock for speed and duplex Wang Zhan
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox