ovpn: reduce reference-count contention
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v2 Latest2 patches 0 repliesNew
- v12 patches 0 repliesSuperseded
Patches in v2 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | ovpn: use percpu references for peersdrivers/ drivers/ drivers/ +2 more | +69 | 0 replies | |
| 2/2 | ovpn: use percpu references for key slotsdrivers/ drivers/ drivers/ | +43 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.
Cover letter [Openvpn-devel] [PATCH ovpn net-next v2 0/2] ovpn: reduce reference-count contention
Hi,
Currently ovpn holds peer and key-slot references while packets are being processed and until asynchronous crypto completes. With traffic for one peer spread across CPUs, the shared kref cachelines therefore become contended even though both objects are normally long-lived.
This series converts both references to percpu_ref while preserving their existing RCU-delayed destruction. The individual patch messages describe the memory cost and cache-to-cache measurements.
The test used one peer, one AES-128-GCM key and 32 TCP streams on a 32-logical-CPU Ryzen 9 9950X with a ConnectX-5 hairpin. The encrypted RX flow used one source port and one receive queue, so only TX exercised CPU fan-out. perf c2c showed that each shared reference cacheline disappeared after its respective conversion.
Thanks,
Ralf Lici
Mandelbit Srl
---
Changes since v1 https://lore.kernel.org/openvpn-devel/[email protected]/
- In 1/2, distinguish reference acquisitions which extend existing peer ownership from RCU lookups which must reject dying peers. (Sashiko)
- In 2/2, avoid a nested RCU callback during key-slot release which
could outlive the ovpn workqueue during module unload. (Sashiko)
Ralf Lici (2):
ovpn: use percpu references for peers
ovpn: use percpu references for key slots
drivers/net/ovpn/crypto.c | 16 +++++++-------- drivers/net/ovpn/crypto.h | 27 ++++++++++++++++++++----- drivers/net/ovpn/crypto_aead.c | 17 ++++++++++++---- drivers/net/ovpn/io.c | 6 +----- drivers/net/ovpn/netlink.c | 6 +++--- drivers/net/ovpn/peer.c | 37 +++++++++++++++++++++------------- drivers/net/ovpn/peer.h | 37 ++++++++++++++++++++++++++++------ drivers/net/ovpn/tcp.c | 23 ++++++++++----------- 8 files changed, 112 insertions(+), 57 deletions(-)
base-commit: b8e9e7d82e7eefd5d2d528469d94ec20e96b38c3
Signature · 8 lines
2.55.0 _______________________________________________ Openvpn-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/openvpn-devel