On 10/30/18 12:31 PM, David Miller wrote: > From: Jeff Barnhill <0xeff...@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 <da...@davemloft.net> 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.