From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753476AbdJaOKC (ORCPT ); Tue, 31 Oct 2017 10:10:02 -0400 Received: from mail-pg0-f67.google.com ([74.125.83.67]:53207 "EHLO mail-pg0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752209AbdJaOKA (ORCPT ); Tue, 31 Oct 2017 10:10:00 -0400 X-Google-Smtp-Source: ABhQp+R3hvWC2oeO+J89puM1FY+RK2ELG16/zxbb1+l3+tkTp9ub7/NSy3ICi4M8LEGKCIRPwEfXEg== Message-ID: <1509458998.3828.19.camel@edumazet-glaptop3.roam.corp.google.com> Subject: Re: [PATCH net-next 3/4] hv_netvsc: reset net_device_ctx->nvdev with rcu_assign_pointer() From: Eric Dumazet To: Vitaly Kuznetsov Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, devel@linuxdriverproject.org, "K. Y. Srinivasan" , Haiyang Zhang , Stephen Hemminger Date: Tue, 31 Oct 2017 07:09:58 -0700 In-Reply-To: <20171031134204.15287-4-vkuznets@redhat.com> References: <20171031134204.15287-1-vkuznets@redhat.com> <20171031134204.15287-4-vkuznets@redhat.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.10.4-0ubuntu2 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.