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 -- 2.55.0 _______________________________________________ Openvpn-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/openvpn-devel
