]> git.baikalelectronics.ru Git - kernel.git/commit
net: Don't take rtnl_lock() in wireless_nlevent_flush()
authorKirill Tkhai <ktkhai@virtuozzo.com>
Thu, 29 Mar 2018 16:20:44 +0000 (19:20 +0300)
committerDavid S. Miller <davem@davemloft.net>
Thu, 29 Mar 2018 17:47:53 +0000 (13:47 -0400)
commit8954c3d6f2733562e50cbb9f68254a2f73db41e9
treeb7d0b2d3e6f7e844b3f401bd7c1a5a9716f9735b
parentf6ea9655a9d4c5c1111abf8ad4d3db8f026ce3a3
net: Don't take rtnl_lock() in wireless_nlevent_flush()

This function iterates over net_namespace_list and flushes
the queue for every of them. What does this rtnl_lock()
protects?! Since we may add skbs to net::wext_nlevents
without rtnl_lock(), it does not protects us about queuers.

It guarantees, two threads can't flush the queue in parallel,
that can change the order, but since skb can be queued
in any order, it doesn't matter, how many threads do this
in parallel. In case of several threads, this will be even
faster.

So, we can remove rtnl_lock() here, as it was used for
iteration over net_namespace_list only.

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/wireless/wext-core.c