From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matthew Wilcox Subject: Re: linux-next: build failure after merge of the ida tree Date: Wed, 18 Jul 2018 06:14:46 -0700 Message-ID: <20180718131446.GC4949@bombadil.infradead.org> References: <20180718165406.6f262266@canb.auug.org.au> <20180718092426.mxdti3jes5jsssta@salvia> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <20180718092426.mxdti3jes5jsssta@salvia> Sender: linux-kernel-owner@vger.kernel.org To: Pablo Neira Ayuso Cc: Stephen Rothwell , NetFilter , Linux-Next Mailing List , Linux Kernel Mailing List , Varsha Rao List-Id: linux-next.vger.kernel.org On Wed, Jul 18, 2018 at 11:24:26AM +0200, Pablo Neira Ayuso wrote: > > interacting with commit > > > > 9679150a0bd5 ("netfilter: nf_tables: Use id allocation") > > > > from the netfilter-next tree. > > @Varsha, I'm very sorry, but I guess I have to toss your patch, I > would prefer avoid dependencies with the IDA API by now. I've had a chance to read this patch a bit more carefully. It transforms one anti-pattern into another, so I can't say I'm a fan. The first is specific to the networking code; having a list of things with IDs, and constructing a bitmap when we need to allocate a new ID. The second is having both an IDA and a list of things. The more effective way to do all of this is to use an IDR. You can get rid of the linked list *and* the IDA, and it's faster to iterate over. The root of the IDR is the same size as the list_head, and then you need only store the 4-byte ID in each element instead of the 16-byte list_head. So Varsha, if you would like to take a look at transforming table->sets from a LIST_HEAD to an IDR, I think that would be a great use of your time.