When looking at something else, I noticed that the local endpoint
entries list was iterated under rcu_read_lock, but using
list_for_each_entry() instead of the _rcu variant. That's what patch 1
is fixing.
At the previous meeting, Mat and Christoph mentioned we could use the
RCU variant elsewhere. That's what is done in patch 2, for -next then.
Patch 3 is a simple change to remove duplicated code.
Note: I see that we are using spin_lock_bh(), but the RCU read "locks"
are always used without the _bh() variant. Is that OK here, or did we
miss something?
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
---
Changes in v3:
- Use list_for_each_entry_rcu() with a 4th parameter: lockdep_is_held()
- See individual changelog in the different patches.
- Link to v2: https://lore.kernel.org/r/20241025-mptcp-pm-lookup_addr_rcu-v2-0-1478f6c4b205@kernel.org
Changes in v2:
- Add patch 2 and 3
- Patch 1: avoid > 80 chars per line in __lookup_addr_rcu() + update
commit message.
- Link to v1: https://lore.kernel.org/r/20241022-mptcp-pm-lookup_addr_rcu-v1-1-19d45f26c872@kernel.org
---
Geliang Tang (1):
mptcp: pm: avoid code duplication to lookup endp
Matthieu Baerts (NGI0) (2):
mptcp: pm: use _rcu variant under rcu_read_lock
mptcp: pm: lockless list traversal to dump endpoints
net/mptcp/pm_netlink.c | 36 +++++++++++++++---------------------
1 file changed, 15 insertions(+), 21 deletions(-)
---
base-commit: ca26062fcd85c61922f543674c5dd0382e2059cd
change-id: 20241022-mptcp-pm-lookup_addr_rcu-01833ea95155
Best regards,
--
Matthieu Baerts (NGI0) <matttbe@kernel.org>