From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Miller Subject: Re: [PATCH net v5] net/ipv6: Add anycast addresses to a global hashtable Date: Tue, 30 Oct 2018 11:31:47 -0700 (PDT) Message-ID: <20181030.113147.173837020180526004.davem@davemloft.net> References: <20181028015159.10636-1-0xeffeff@gmail.com> <20181029.203211.604037421868394185.davem@davemloft.net> Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: netdev@vger.kernel.org, kuznet@ms2.inr.ac.ru, yoshfuji@linux-ipv6.org To: 0xeffeff@gmail.com Return-path: Received: from shards.monkeyblade.net ([23.128.96.9]:58232 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727674AbeJaD0X (ORCPT ); Tue, 30 Oct 2018 23:26:23 -0400 In-Reply-To: Sender: netdev-owner@vger.kernel.org List-ID: From: Jeff Barnhill <0xeffeff@gmail.com> Date: Tue, 30 Oct 2018 07:10:58 -0400 > I originally started implementing it the way you suggested; however, > it seemed to complicate management of that structure because it isn't > currently using rcu. Also, assuming that can be worked out, where > would I get the net from? Would I need to store a copy in ifcaddr6, > or is there some way to access it during ipv6_chk_acast_addr()? It > seems that if I don't add a copy of net, but instead access it through > aca_rt(?), then freeing the ifcaddr6 memory becomes problematic > (detaching it from idev, while read_rcu may still be accessing it). > On Mon, Oct 29, 2018 at 11:32 PM David Miller wrote: I don't think converting the structure over to RCU, especially because all of the read paths (everything leading to ipv6_chk_acast_dev()) are taking RCU locks already. And I cannot understand how having _two_ structures to manage a piece of information can be less complicated than just one. You can add a backpointer to the 'idev' in ifacaddr6 to get at the network namespace. You don't even need to do additional reference counting because the idev->ac_list is always purged before an idev is destroyed.