diff options
author | Matthieu Baerts (NGI0) <matttbe@kernel.org> | 2024-11-15 17:52:34 +0100 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2024-11-18 18:50:13 -0800 |
commit | 3fbb27b7f87e60324cec7d2d10a40884182c99d4 (patch) | |
tree | 722f9df80b4cc5e248ed6e03a8ae36b29fe42941 /net/key | |
parent | cc84d89ad8d411d52ec4d000c3ed5cce52683fbd (diff) |
mptcp: pm: lockless list traversal to dump endp
To return an endpoint to the userspace via Netlink, and to dump all of
them, the endpoint list was iterated while holding the pernet->lock, but
only to read the content of the list.
In these cases, the spin locks can be replaced by RCU read ones, and use
the _rcu variants to iterate over the entries list in a lockless way.
Note that the __lookup_addr_by_id() helper has been modified to use the
_rcu variants of list_for_each_entry(), but with an extra conditions, so
it can be called either while the RCU read lock is held, or when the
associated pernet->lock is held.
Reviewed-by: Geliang Tang <geliang@kernel.org>
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Link: https://patch.msgid.link/20241115-net-next-mptcp-pm-lockless-dump-v1-1-f4a1bcb4ca2c@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net/key')
0 files changed, 0 insertions, 0 deletions