aboutsummaryrefslogtreecommitdiffstats
path: root/net/wireless/wext-core.c
diff options
context:
space:
mode:
authorKirill Tkhai <ktkhai@virtuozzo.com>2018-03-29 12:20:44 -0400
committerDavid S. Miller <davem@davemloft.net>2018-03-29 13:47:53 -0400
commit10256debb918aea083d0ddada64d29014c642a7b (patch)
treeb7d0b2d3e6f7e844b3f401bd7c1a5a9716f9735b /net/wireless/wext-core.c
parentf0b07bb151b098d291fd1fd71ef7a2df56fb124a (diff)
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>
Diffstat (limited to 'net/wireless/wext-core.c')
-rw-r--r--net/wireless/wext-core.c4
1 files changed, 0 insertions, 4 deletions
diff --git a/net/wireless/wext-core.c b/net/wireless/wext-core.c
index 544d7b62d7ca..5e677dac2a0c 100644
--- a/net/wireless/wext-core.c
+++ b/net/wireless/wext-core.c
@@ -347,8 +347,6 @@ void wireless_nlevent_flush(void)
347 struct sk_buff *skb; 347 struct sk_buff *skb;
348 struct net *net; 348 struct net *net;
349 349
350 ASSERT_RTNL();
351
352 down_read(&net_rwsem); 350 down_read(&net_rwsem);
353 for_each_net(net) { 351 for_each_net(net) {
354 while ((skb = skb_dequeue(&net->wext_nlevents))) 352 while ((skb = skb_dequeue(&net->wext_nlevents)))
@@ -412,9 +410,7 @@ subsys_initcall(wireless_nlevent_init);
412/* Process events generated by the wireless layer or the driver. */ 410/* Process events generated by the wireless layer or the driver. */
413static void wireless_nlevent_process(struct work_struct *work) 411static void wireless_nlevent_process(struct work_struct *work)
414{ 412{
415 rtnl_lock();
416 wireless_nlevent_flush(); 413 wireless_nlevent_flush();
417 rtnl_unlock();
418} 414}
419 415
420static DECLARE_WORK(wireless_nlevent_work, wireless_nlevent_process); 416static DECLARE_WORK(wireless_nlevent_work, wireless_nlevent_process);