linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vitaly Kuznetsov <vkuznets@redhat.com>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	devel@linuxdriverproject.org,
	"K. Y. Srinivasan" <kys@microsoft.com>,
	Haiyang Zhang <haiyangz@microsoft.com>,
	Stephen Hemminger <sthemmin@microsoft.com>
Subject: Re: [PATCH net-next 3/4] hv_netvsc: reset net_device_ctx->nvdev with rcu_assign_pointer()
Date: Tue, 31 Oct 2017 15:40:06 +0100	[thread overview]
Message-ID: <8760avxtx5.fsf@vitty.brq.redhat.com> (raw)
In-Reply-To: <1509458998.3828.19.camel@edumazet-glaptop3.roam.corp.google.com> (Eric Dumazet's message of "Tue, 31 Oct 2017 07:09:58 -0700")

Eric Dumazet <eric.dumazet@gmail.com> writes:

> On Tue, 2017-10-31 at 14:42 +0100, Vitaly Kuznetsov wrote:
>> RCU_INIT_POINTER() is not suitable here as it doesn't give us ordering
>> guarantees (see the comment in rcupdate.h). This is also not a hotpath.
>> 
>> Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
>> ---
>>  drivers/net/hyperv/netvsc.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>> 
>> diff --git a/drivers/net/hyperv/netvsc.c b/drivers/net/hyperv/netvsc.c
>> index bfc79698b8f4..12efb3e34775 100644
>> --- a/drivers/net/hyperv/netvsc.c
>> +++ b/drivers/net/hyperv/netvsc.c
>> @@ -560,7 +560,7 @@ void netvsc_device_remove(struct hv_device *device)
>>  
>>  	netvsc_revoke_buf(device, net_device);
>>  
>> -	RCU_INIT_POINTER(net_device_ctx->nvdev, NULL);
>> +	rcu_assign_pointer(net_device_ctx->nvdev, NULL);
>
> I see no point for this patch.
>
> Setting a NULL pointer needs no barrier at all.

Oh, sorry, I got confused by the comment near RCU_INIT_POINTER() in
rcupdate.h. Now looking at their definitions I see.

This patch can of course be dropped from the series.

-- 
  Vitaly

  reply	other threads:[~2017-10-31 14:40 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-31 13:42 [PATCH net-next 0/4] hv_netvsc: fix some crashes and hangs on channel/mtu changes Vitaly Kuznetsov
2017-10-31 13:42 ` [PATCH net-next 1/4] hv_netvsc: netvsc_teardown_gpadl() split Vitaly Kuznetsov
2017-10-31 16:37   ` Stephen Hemminger
2017-10-31 13:42 ` [PATCH net-next 2/4] hv_netvsc: protect nvdev->extension with RCU Vitaly Kuznetsov
2017-10-31 16:44   ` Stephen Hemminger
2017-10-31 17:13     ` Vitaly Kuznetsov
2017-11-02 10:27       ` Vitaly Kuznetsov
2017-10-31 13:42 ` [PATCH net-next 3/4] hv_netvsc: reset net_device_ctx->nvdev with rcu_assign_pointer() Vitaly Kuznetsov
2017-10-31 14:09   ` Eric Dumazet
2017-10-31 14:40     ` Vitaly Kuznetsov [this message]
2017-10-31 14:44       ` David Miller
2017-10-31 14:50         ` Vitaly Kuznetsov
2017-10-31 16:45     ` Stephen Hemminger
2017-10-31 13:42 ` [PATCH net-next 4/4] hv_netvsc: hide warnings about uninitialized/missing rndis device Vitaly Kuznetsov

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=8760avxtx5.fsf@vitty.brq.redhat.com \
    --to=vkuznets@redhat.com \
    --cc=devel@linuxdriverproject.org \
    --cc=eric.dumazet@gmail.com \
    --cc=haiyangz@microsoft.com \
    --cc=kys@microsoft.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=sthemmin@microsoft.com \
    /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).