From: Matthew Wilcox <willy@infradead.org>
To: Pablo Neira Ayuso <pablo@netfilter.org>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>,
NetFilter <netfilter-devel@vger.kernel.org>,
Linux-Next Mailing List <linux-next@vger.kernel.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Varsha Rao <rvarsha016@gmail.com>
Subject: Re: linux-next: build failure after merge of the ida tree
Date: Wed, 18 Jul 2018 06:14:46 -0700 [thread overview]
Message-ID: <20180718131446.GC4949@bombadil.infradead.org> (raw)
In-Reply-To: <20180718092426.mxdti3jes5jsssta@salvia>
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.
next prev parent reply other threads:[~2018-07-18 13:14 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-18 6:54 linux-next: build failure after merge of the ida tree Stephen Rothwell
2018-07-18 9:24 ` Pablo Neira Ayuso
2018-07-18 11:59 ` Matthew Wilcox
2018-07-18 13:25 ` Pablo Neira Ayuso
2018-07-18 13:14 ` Matthew Wilcox [this message]
2018-07-18 13:27 ` Pablo Neira Ayuso
2018-07-18 13:31 ` Matthew Wilcox
2018-07-18 14:25 ` Pablo Neira Ayuso
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180718131446.GC4949@bombadil.infradead.org \
--to=willy@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-next@vger.kernel.org \
--cc=netfilter-devel@vger.kernel.org \
--cc=pablo@netfilter.org \
--cc=rvarsha016@gmail.com \
--cc=sfr@canb.auug.org.au \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).