All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH mptcp-net v2 0/3] mptcp: pm: use _rcu variant under rcu_read_lock
@ 2024-10-25  9:32 Matthieu Baerts (NGI0)
  2024-10-25  9:32 ` [PATCH mptcp-net v2 1/3] " Matthieu Baerts (NGI0)
                   ` (3 more replies)
  0 siblings, 4 replies; 19+ messages in thread
From: Matthieu Baerts (NGI0) @ 2024-10-25  9:32 UTC (permalink / raw)
  To: mptcp; +Cc: Paolo Abeni, Matthieu Baerts (NGI0), Geliang Tang

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 should also use
this _rcu variant in mptcp_pm_nl_set_flags(). But then the modifications
look too important for -net, because __lookup_addr_by_id() also needs to
be modified, and similar parts in the code as well to harmonise how
entries are read from the list. 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 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

 net/mptcp/pm_netlink.c | 69 +++++++++++++++++++++++++++-----------------------
 1 file changed, 38 insertions(+), 31 deletions(-)
---
base-commit: c2990db510fcdde78645791def80551c0f77ff76
change-id: 20241022-mptcp-pm-lookup_addr_rcu-01833ea95155

Best regards,
-- 
Matthieu Baerts (NGI0) <matttbe@kernel.org>


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

end of thread, other threads:[~2024-11-06 16:23 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-25  9:32 [PATCH mptcp-net v2 0/3] mptcp: pm: use _rcu variant under rcu_read_lock Matthieu Baerts (NGI0)
2024-10-25  9:32 ` [PATCH mptcp-net v2 1/3] " Matthieu Baerts (NGI0)
2024-10-25  9:32 ` [PATCH mptcp-net v2 2/3] mptcp: pm: lockless list traversal Matthieu Baerts (NGI0)
2024-10-25 14:25   ` Geliang Tang
2024-10-25 15:26     ` Matthieu Baerts
2024-10-28  2:08       ` Geliang Tang
2024-10-28 11:48         ` Matthieu Baerts
2024-10-29  8:43           ` Geliang Tang
2024-10-31 23:24             ` Mat Martineau
2024-11-06 16:03               ` Matthieu Baerts
2024-10-25 15:17   ` Matthieu Baerts
2024-10-31 22:14     ` Mat Martineau
2024-11-05 18:21   ` Paolo Abeni
2024-11-06 16:23     ` Matthieu Baerts
2024-10-25  9:32 ` [PATCH mptcp-net v2 3/3] mptcp: pm: avoid code duplication to lookup endp Matthieu Baerts (NGI0)
2024-10-25 10:37   ` Geliang Tang
2024-10-25 10:44     ` Matthieu Baerts
2024-10-25 10:47     ` Geliang Tang
2024-10-25 10:49 ` [PATCH mptcp-net v2 0/3] mptcp: pm: use _rcu variant under rcu_read_lock MPTCP CI

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.