Skip to content

net: sysfs: use ops lock for speed and duplex

Wang Zhan netdev 2 versions – Applied

Status from this message: This series was applied to netdev/net-next.git (main)

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest2 patches 0 repliesApplied 2/2
  2. v11 patch 1 replySuperseded

Changes in v2 from the cover letter

- Split the common-code refactoring from the locking change.
- Keep speed_show() and duplex_show() focused on formatting the result.

Patches in v2 All 2 applied

#Subject and filesSizeRepliesApplied
1/2net: sysfs: factor out link settings readnet/core/net-sysfs.c+48 -490 repliesApplied
2/2net: sysfs: use ops lock for speed and duplexnet/core/net-sysfs.c+21 -60 repliesApplied

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH net-next v2 0/2] net: sysfs: use ops lock for speed and duplex

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/[email protected]/

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

Signature · 1 line
2.47.3