Commit d4e415f
mptcp: pm: lockless list traversal to dump endpoints
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.
Signed-off-by: Matthieu Baerts (NGI0) <[email protected]>1 parent 887a8ea commit d4e415f
1 file changed
+7
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
512 | 512 | | |
513 | 513 | | |
514 | 514 | | |
515 | | - | |
| 515 | + | |
| 516 | + | |
516 | 517 | | |
517 | 518 | | |
518 | 519 | | |
| |||
1824 | 1825 | | |
1825 | 1826 | | |
1826 | 1827 | | |
1827 | | - | |
| 1828 | + | |
1828 | 1829 | | |
1829 | 1830 | | |
1830 | 1831 | | |
| |||
1838 | 1839 | | |
1839 | 1840 | | |
1840 | 1841 | | |
1841 | | - | |
| 1842 | + | |
1842 | 1843 | | |
1843 | 1844 | | |
1844 | 1845 | | |
1845 | | - | |
| 1846 | + | |
1846 | 1847 | | |
1847 | 1848 | | |
1848 | 1849 | | |
| |||
1866 | 1867 | | |
1867 | 1868 | | |
1868 | 1869 | | |
1869 | | - | |
| 1870 | + | |
1870 | 1871 | | |
1871 | 1872 | | |
1872 | 1873 | | |
| |||
1891 | 1892 | | |
1892 | 1893 | | |
1893 | 1894 | | |
1894 | | - | |
| 1895 | + | |
1895 | 1896 | | |
1896 | 1897 | | |
1897 | 1898 | | |
| |||
0 commit comments