From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753456AbdJaOkL (ORCPT ); Tue, 31 Oct 2017 10:40:11 -0400 Received: from mx1.redhat.com ([209.132.183.28]:45072 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753332AbdJaOkK (ORCPT ); Tue, 31 Oct 2017 10:40:10 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 038A237E70 Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=vkuznets@redhat.com From: Vitaly Kuznetsov To: Eric Dumazet Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, devel@linuxdriverproject.org, "K. Y. Srinivasan" , Haiyang Zhang , Stephen Hemminger Subject: Re: [PATCH net-next 3/4] hv_netvsc: reset net_device_ctx->nvdev with rcu_assign_pointer() References: <20171031134204.15287-1-vkuznets@redhat.com> <20171031134204.15287-4-vkuznets@redhat.com> <1509458998.3828.19.camel@edumazet-glaptop3.roam.corp.google.com> Date: Tue, 31 Oct 2017 15:40:06 +0100 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") Message-ID: <8760avxtx5.fsf@vitty.brq.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Tue, 31 Oct 2017 14:40:10 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Eric Dumazet 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 >> --- >> 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