From: David Miller <davem@davemloft.net>
To: vincent@bernat.im
Cc: kuznet@ms2.inr.ac.ru, yoshfuji@linux-ipv6.org, jiri@mellanox.com,
netdev@vger.kernel.org, dsa@cumulusnetworks.com
Subject: Re: [PATCH net-next v2] net: ipv6: avoid overhead when no custom FIB rules are installed
Date: Tue, 08 Aug 2017 21:40:23 -0700 (PDT) [thread overview]
Message-ID: <20170808.214023.1367570931294936647.davem@davemloft.net> (raw)
In-Reply-To: <20170808182349.4987-1-vincent@bernat.im>
From: Vincent Bernat <vincent@bernat.im>
Date: Tue, 8 Aug 2017 20:23:49 +0200
> If the user hasn't installed any custom rules, don't go through the
> whole FIB rules layer. This is pretty similar to f4530fa574df (ipv4:
> Avoid overhead when no custom FIB rules are installed).
>
> Using a micro-benchmark module [1], timing ip6_route_output() with
> get_cycles(), with 40,000 routes in the main routing table, before this
> patch:
>
> min=606 max=12911 count=627 average=1959 95th=4903 90th=3747 50th=1602 mad=821
> table=254 avgdepth=21.8 maxdepth=39
> value │ ┊ count
> 600 │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ 199
> 880 │▒▒▒░░░░░░░░░░░░░░░░ 43
> 1160 │▒▒▒░░░░░░░░░░░░░░░░░░░░ 48
> 1440 │▒▒▒░░░░░░░░░░░░░░░░░░░░░░░ 43
> 1720 │▒▒▒▒░░░░░░░░░░░░░░░░░░░░░░░░░░░ 59
> 2000 │▒▒▒░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 50
> 2280 │▒▒░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 26
> 2560 │▒▒░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 31
> 2840 │▒▒░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 28
> 3120 │▒░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 17
> 3400 │▒░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 17
> 3680 │░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 8
> 3960 │░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 11
> 4240 │░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 6
> 4520 │░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 6
> 4800 │░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 9
>
> After:
>
> min=544 max=11687 count=627 average=1776 95th=4546 90th=3585 50th=1227 mad=565
> table=254 avgdepth=21.8 maxdepth=39
> value │ ┊ count
> 540 │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ 201
> 800 │▒▒▒▒▒░░░░░░░░░░░░░░░░ 63
> 1060 │▒▒▒▒▒░░░░░░░░░░░░░░░░░░░░░ 68
> 1320 │▒▒▒░░░░░░░░░░░░░░░░░░░░░░░░░░ 39
> 1580 │▒▒░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 32
> 1840 │▒▒░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 32
> 2100 │▒▒░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 34
> 2360 │▒▒░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 33
> 2620 │▒▒░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 26
> 2880 │▒░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 22
> 3140 │░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 9
> 3400 │░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 8
> 3660 │░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 9
> 3920 │░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 8
> 4180 │░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 8
> 4440 │░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 8
>
> At the frequency of the host during the bench (~ 3.7 GHz), this is
> about a 100 ns difference on the median value.
>
> A next step would be to collapse local and main tables, as in
> 0ddcf43d5d4a (ipv4: FIB Local/MAIN table collapse).
>
> [1]: https://github.com/vincentbernat/network-lab/blob/master/lab-routes-ipv6/kbench_mod.c
>
> Signed-off-by: Vincent Bernat <vincent@bernat.im>
> Reviewed-by: Jiri Pirko <jiri@mellanox.com>
Looks great, applied, thanks!
prev parent reply other threads:[~2017-08-09 4:40 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-08 11:51 [net-next v1] net: ipv6: avoid overhead when no custom FIB rules are installed Vincent Bernat
2017-08-08 12:51 ` Jiri Pirko
2017-08-08 14:46 ` David Ahern
2017-08-08 14:50 ` Vincent Bernat
2017-08-08 18:23 ` [PATCH net-next v2] " Vincent Bernat
2017-08-08 19:10 ` David Ahern
2017-08-09 4:40 ` David Miller [this message]
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=20170808.214023.1367570931294936647.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=dsa@cumulusnetworks.com \
--cc=jiri@mellanox.com \
--cc=kuznet@ms2.inr.ac.ru \
--cc=netdev@vger.kernel.org \
--cc=vincent@bernat.im \
--cc=yoshfuji@linux-ipv6.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).