aboutsummaryrefslogtreecommitdiffstats
path: root/net/core/rtnetlink.c
diff options
context:
space:
mode:
authorYajun Deng <yajun.deng@linux.dev>2021-09-18 14:36:07 +0800
committerDavid S. Miller <davem@davemloft.net>2021-09-19 12:56:02 +0100
commit4fc29989835ab7379f807854b5f7338b752b9f1a (patch)
tree129d9b2d493ca913acc2b20e15f1c7c9cf5aa119 /net/core/rtnetlink.c
parentvirtio_net: use netdev_warn_once to output warn when without enough queues (diff)
downloadlinux-dev-4fc29989835ab7379f807854b5f7338b752b9f1a.tar.xz
linux-dev-4fc29989835ab7379f807854b5f7338b752b9f1a.zip
net: rtnetlink: convert rcu_assign_pointer to RCU_INIT_POINTER
It no need barrier when assigning a NULL value to an RCU protected pointer. So use RCU_INIT_POINTER() instead for more fast. Signed-off-by: Yajun Deng <yajun.deng@linux.dev> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to '')
-rw-r--r--net/core/rtnetlink.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
index 972c8cb303a5..327ca6bc6e6d 100644
--- a/net/core/rtnetlink.c
+++ b/net/core/rtnetlink.c
@@ -301,7 +301,7 @@ int rtnl_unregister(int protocol, int msgtype)
}
link = rtnl_dereference(tab[msgindex]);
- rcu_assign_pointer(tab[msgindex], NULL);
+ RCU_INIT_POINTER(tab[msgindex], NULL);
rtnl_unlock();
kfree_rcu(link, rcu);
@@ -337,7 +337,7 @@ void rtnl_unregister_all(int protocol)
if (!link)
continue;
- rcu_assign_pointer(tab[msgindex], NULL);
+ RCU_INIT_POINTER(tab[msgindex], NULL);
kfree_rcu(link, rcu);
}
rtnl_unlock();