netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next 0/4] net-sysfs: remove the rtnl_trylock/restart_syscall construction
@ 2025-01-17 10:26 Antoine Tenart
  2025-01-17 10:26 ` [PATCH net-next 1/4] net-sysfs: remove rtnl_trylock from device attributes Antoine Tenart
                   ` (5 more replies)
  0 siblings, 6 replies; 15+ messages in thread
From: Antoine Tenart @ 2025-01-17 10:26 UTC (permalink / raw)
  To: davem, kuba, pabeni, edumazet; +Cc: Antoine Tenart, stephen, gregkh, netdev

Hi,

The series initially aimed at improving spins (and thus delays) while
accessing net sysfs under rtnl lock contention[1]. The culprit was the
trylock/restart_syscall constructions. There wasn't much interest at the
time but it got traction recently for other reasons (lowering the rtnl
lock pressure).

Since the RFC[1]:

- Limit the breaking of the sysfs protection to sysfs_rtnl_lock() only
  as this is not needed in the whole rtnl locking section thanks to the
  additional check on dev_isalive(). This simplifies error handling as
  well as the unlocking path.
- Used an interruptible version of rtnl_lock, as done by Jakub in
  his experiments.
- Removed a WARN_ONCE_ONCE call [Greg].
- Removed explicit inline markers [Stephen].

Most of the reasoning is explained in comments added in patch 1. This
was tested by stress-testing net sysfs attributes (read/write ops) while
adding/removing queues and adding/removing veths, all in parallel. I
also used an OCP single node cluster, spawning lots of pods.

Thanks,
Antoine

[1] https://lore.kernel.org/all/20231018154804.420823-1-atenart@kernel.org/T/

---

Not sending this as an RFC as I believe this is ready for proper review,
but also note rc7 is there already and we might want this to live for a
bit in net-next before getting to Linus' tree.

Antoine Tenart (4):
  net-sysfs: remove rtnl_trylock from device attributes
  net-sysfs: move queue attribute groups outside the default groups
  net-sysfs: prevent uncleared queues from being re-added
  net-sysfs: remove rtnl_trylock from queue attributes

 include/linux/netdevice.h     |   1 +
 include/linux/rtnetlink.h     |   1 +
 include/net/netdev_rx_queue.h |   1 +
 net/core/net-sysfs.c          | 388 ++++++++++++++++++++++++----------
 net/core/rtnetlink.c          |   6 +
 5 files changed, 280 insertions(+), 117 deletions(-)

-- 
2.48.0


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

end of thread, other threads:[~2025-01-22  9:09 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-17 10:26 [PATCH net-next 0/4] net-sysfs: remove the rtnl_trylock/restart_syscall construction Antoine Tenart
2025-01-17 10:26 ` [PATCH net-next 1/4] net-sysfs: remove rtnl_trylock from device attributes Antoine Tenart
2025-01-17 17:03   ` Stephen Hemminger
2025-01-17 18:35     ` Antoine Tenart
2025-01-17 10:26 ` [PATCH net-next 2/4] net-sysfs: move queue attribute groups outside the default groups Antoine Tenart
2025-01-17 10:26 ` [PATCH net-next 3/4] net-sysfs: prevent uncleared queues from being re-added Antoine Tenart
2025-01-20 19:44   ` Jakub Kicinski
2025-01-21  9:33     ` Antoine Tenart
2025-01-21 17:09       ` Jakub Kicinski
2025-01-22  8:34         ` Antoine Tenart
2025-01-17 10:26 ` [PATCH net-next 4/4] net-sysfs: remove rtnl_trylock from queue attributes Antoine Tenart
2025-01-20 19:40 ` [PATCH net-next 0/4] net-sysfs: remove the rtnl_trylock/restart_syscall construction Jakub Kicinski
2025-01-21  9:38   ` Antoine Tenart
2025-01-22  8:50 ` Maxime Chevallier
2025-01-22  9:09   ` Antoine Tenart

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).