Skip to content

Commit f2c71c4

Browse files
matttbekuba-moo
authored andcommitted
mptcp: remove unneeded lock when listing scheds
mptcp_get_available_schedulers() needs to iterate over the schedulers' list only to read the names: it doesn't modify anything there. In this case, it is enough to hold the RCU read lock, no need to combine this with the associated spin lock as it was done since its introduction in commit 73c900a ("mptcp: add net.mptcp.available_schedulers"). Suggested-by: Paolo Abeni <[email protected]> Reviewed-by: Geliang Tang <[email protected]> Reviewed-by: Simon Horman <[email protected]> Signed-off-by: Matthieu Baerts (NGI0) <[email protected]> Link: https://patch.msgid.link/20241104-net-next-mptcp-sched-unneeded-lock-v2-1-2ccc1e0c750c@kernel.org Signed-off-by: Jakub Kicinski <[email protected]>
1 parent dc0f314 commit f2c71c4

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

net/mptcp/sched.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ void mptcp_get_available_schedulers(char *buf, size_t maxlen)
6060
size_t offs = 0;
6161

6262
rcu_read_lock();
63-
spin_lock(&mptcp_sched_list_lock);
6463
list_for_each_entry_rcu(sched, &mptcp_sched_list, list) {
6564
offs += snprintf(buf + offs, maxlen - offs,
6665
"%s%s",
@@ -69,7 +68,6 @@ void mptcp_get_available_schedulers(char *buf, size_t maxlen)
6968
if (WARN_ON_ONCE(offs >= maxlen))
7069
break;
7170
}
72-
spin_unlock(&mptcp_sched_list_lock);
7371
rcu_read_unlock();
7472
}
7573

0 commit comments

Comments
 (0)