From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Ahern Subject: Re: [PATCH net v5] net/ipv6: Add anycast addresses to a global hashtable Date: Tue, 30 Oct 2018 16:06:46 -0600 Message-ID: <75a6a4bb-a8f3-4996-a157-825a5834ae52@gmail.com> References: <20181028015159.10636-1-0xeffeff@gmail.com> <20181029.203211.604037421868394185.davem@davemloft.net> <20181030.113147.173837020180526004.davem@davemloft.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: netdev@vger.kernel.org, kuznet@ms2.inr.ac.ru, yoshfuji@linux-ipv6.org To: David Miller , 0xeffeff@gmail.com Return-path: Received: from mail-pf1-f195.google.com ([209.85.210.195]:33856 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728388AbeJaHCD (ORCPT ); Wed, 31 Oct 2018 03:02:03 -0400 Received: by mail-pf1-f195.google.com with SMTP id f78-v6so6558812pfe.1 for ; Tue, 30 Oct 2018 15:06:49 -0700 (PDT) In-Reply-To: <20181030.113147.173837020180526004.davem@davemloft.net> Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-ID: On 10/30/18 12:31 PM, David Miller wrote: > 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. > or make the table per namespace.