From: David Miller <davem@davemloft.net>
To: netdev@vger.kernel.org
Subject: [PATCH 0/25] Kill stack space gaps due to flowi layout.
Date: Sat, 12 Mar 2011 15:23:51 -0800 (PST) [thread overview]
Message-ID: <20110312.152351.189687538.davem@davemloft.net> (raw)
One thing we got wrong from the beginning was the layout of
struct flowi. It's suboptimal by design.
For ipv4, for example, huge gaps exist between the addressing
information and the "ports". This is because we put the
addressing information for all AF types side-by-side in a
union so there is a gap because the ipv6 addresses take up
more space.
There were also completely unused portions of struct flowi due
to padding.
So as a result we get less dense data accesses, and therefore
less successful store buffer compression and less cache locality.
Lucky for us, all code paths that touch the AF dependent portions
do so in an AF dependent context. Therefore we can lay things out
any way we like.
So these changes pack things together as tightly as possible for
each AF variant. And AF independent code is only allowed to
make references to the "common" area at the beginning of each
AF instance.
Performance improvement is measurable, even a routing cache hit
output route lookup is ~20 cycles faster on Niagara2. udpflood
tests are also faster by several seconds.
I tried to minimize the noise and churn by making ipv4 helpers
for various common cases of route lookups. But some code paths
want to do something very special (f.e. icmp) and I did not work
on such helpers for ipv6. That can be done at a later time.
And in fact, ipv6 is really an area ripe for consolidation of routing
lookups. The same flowlabel resolution sequence probably occurs 10
times in the tree.
And hey, even decnet got some love here.
What I'll do tonight is push this to net-next-2.6 and then respin
the routing cache deletion patches, since those obviously won't
apply any longer. :)
reply other threads:[~2011-03-12 23:23 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20110312.152351.189687538.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
/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).