From: Xiaozhou Liu <liuxiaozhou@bytedance.com>
To: netdev@vger.kernel.org
Cc: "David S . Miller" <davem@davemloft.net>,
Xiaozhou Liu <liuxiaozhou@bytedance.com>
Subject: [PATCH net] soreuseport: use RCU_INIT_POINTER() when NULLing
Date: Wed, 12 Dec 2018 17:58:12 +0800 [thread overview]
Message-ID: <20181212095812.27541-1-liuxiaozhou@bytedance.com> (raw)
Use RCU_INIT_POINTER() instead of rcu_assign_pointer() to
NULL out the pointer because it is a bit faster.
Signed-off-by: Xiaozhou Liu <liuxiaozhou@bytedance.com>
---
net/core/sock_reuseport.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/core/sock_reuseport.c b/net/core/sock_reuseport.c
index d8fe3e549373..25e71355f0a6 100644
--- a/net/core/sock_reuseport.c
+++ b/net/core/sock_reuseport.c
@@ -205,7 +205,7 @@ void reuseport_detach_sock(struct sock *sk)
if (reuse->reuseport_id)
bpf_sk_reuseport_detach(sk);
- rcu_assign_pointer(sk->sk_reuseport_cb, NULL);
+ RCU_INIT_POINTER(sk->sk_reuseport_cb, NULL);
for (i = 0; i < reuse->num_socks; i++) {
if (reuse->socks[i] == sk) {
--
2.11.0
next reply other threads:[~2018-12-12 9:58 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-12 9:58 Xiaozhou Liu [this message]
2018-12-12 13:08 ` [PATCH net] soreuseport: use RCU_INIT_POINTER() when NULLing Eric Dumazet
2018-12-13 3:35 ` Xiaozhou Liu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20181212095812.27541-1-liuxiaozhou@bytedance.com \
--to=liuxiaozhou@bytedance.com \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).