From: David Miller <davem@davemloft.net>
To: bcrl@lhnet.ca
Cc: netdev@vger.kernel.org
Subject: Re: [RFC PATCH] fib_hash: improve route deletion scaling on interface drop with lots of interfaces
Date: Mon, 26 Oct 2009 17:17:49 -0700 (PDT) [thread overview]
Message-ID: <20091026.171749.106971240.davem@davemloft.net> (raw)
In-Reply-To: <20091027000302.GA3141@kvack.org>
From: Benjamin LaHaise <bcrl@lhnet.ca>
Date: Mon, 26 Oct 2009 20:03:02 -0400
> Below is a patch to improve the scaling of interface destruction in
> fib_hash. The general idea is to tie the fib_alias structure into a
> list off of net_device and walk that list during a fib_flush() caused
> by an interface drop. This makes the resulting flush only have to walk
> the number of routes attached to an interface rather than the number of
> routes attached to all interfaces at the expense of a couple of additional
> pointers in struct fib_alias.
>
> This patch is against Linus' tree. I'll post against net-next after a
> bit more testing and feedback. With 20,000 interfaces & routes, interface
> deletion time improves from 53s to 40s. Note that this is with other changes
> applied to improve sysfs and procfs scaling, as otherwise those are the
> bottleneck. Next up in the network code is rt_cache_flush(). Comments?
On a real router adding and removing routes is happening a lot
whereas interface changes are rare. You're making a more common
operation more expensive for the sake of a less common one.
> @@ -128,18 +128,19 @@ void fib_select_default(struct net *net,
> tb->tb_select_default(tb, flp, res);
> }
>
> -static void fib_flush(struct net *net)
> +static void fib_flush(struct net_device *dev)
> {
> int flushed = 0;
> struct fib_table *tb;
> struct hlist_node *node;
> struct hlist_head *head;
> unsigned int h;
> + struct net *net = dev_net(dev);
>
Please put local variable lines that are longer at the beginning of
the list of variable declarations at the top of a function, not the
other way around which stands out like a sore thumb and looks ugly.
next prev parent reply other threads:[~2009-10-27 0:17 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-27 0:03 [RFC PATCH] fib_hash: improve route deletion scaling on interface drop with lots of interfaces Benjamin LaHaise
2009-10-27 0:17 ` David Miller [this message]
2009-10-27 14:24 ` Benjamin LaHaise
2009-10-28 1:01 ` David Miller
2009-10-27 0:24 ` Stephen Hemminger
2009-10-27 21:07 ` Julian Anastasov
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=20091026.171749.106971240.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=bcrl@lhnet.ca \
--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).