[PATCH net-next v2 0/2] net: sysfs: use ops lock for speed and duplex
From: Wang Zhan <hidden>
Date: 2026-09-03 13:33:56
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/ (local) 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