From: Ben Greear <greearb@candelatech.com>
To: Andi Kleen <ak@suse.de>
Cc: linux-kernel <linux-kernel@vger.kernel.org>,
"netdev@oss.sgi.com" <netdev@oss.sgi.com>,
"David S. Miller" <davem@redhat.com>
Subject: Re: [PATCH] hashed device lookup (Does NOT meet Linus' sumission policy!) (Benchmarks)
Date: Sun, 07 Jan 2001 01:11:11 -0700 [thread overview]
Message-ID: <3A58249F.86DD52BC@candelatech.com> (raw)
In-Reply-To: <3A578F27.D2A9DF52@candelatech.com> <20010107042959.A14330@gruyere.muc.suse.de> <3A580B31.7998C783@candelatech.com> <20010107062744.A15198@gruyere.muc.suse.de>
[-- Attachment #1: Type: text/plain, Size: 5587 bytes --]
Andi Kleen wrote:
> > I'm willing to run such benchmarks, but what would make a good benchmark,
> > other than ifconfig -a?
>
> ifconfig -a is fine IMHO. Everything else I know is just a single pass through
> the lists (which even at 4000 is not very significant)
Hardware: Celeron 500, mostly idle (ie not too scientific!!)
ifconfig:
[root@candle bin]# /sbin/ifconfig --version
net-tools 1.57
ifconfig 1.40 (2000-05-21)
(vlan_test.pl is attached)
My conclusion: The patch definately helps in this instance, but
this instance may not be realistic.
***********************************************************************
This is with the hash patch enabled: (2.4.prerelease + VLAN patch) (run 2)
***********************************************************************
[root@candle bin]# time vlan_test.pl
Adding VLAN interfaces 1 through 4000
Done adding 4000 VLAN interfaces in 76 seconds.
Doing ifconfig -a
10.47user 6.33system 0:16.80elapsed 99%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (116major+421minor)pagefaults 0swaps
Removing VLAN interfaces 1 through 4000
Done deleting 4000 VLAN interfaces in 58 seconds.
Going to add and remove 2 interfaces 1000 times.
Done adding/removing 2 VLAN interfaces 1000 times in 46 seconds.
74.12user 115.26system 3:22.81elapsed 93%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (2821121major+677780minor)pagefaults 0swaps
***********************************************************************
This is with the patch disabled: (2.4.0 + VLAN patch) (run 1)
***********************************************************************
[root@candle /root]# time vlan_test.pl
Adding VLAN interfaces 1 through 4000
Done adding 4000 VLAN interfaces in 132 seconds.
Doing ifconfig -a
10.72user 96.31system 1:55.31elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (117major+423minor)pagefaults 0swaps
Removing VLAN interfaces 1 through 4000
Done deleting 4000 VLAN interfaces in 65 seconds.
Going to add and remove 2 interfaces 1000 times.
Done adding/removing 2 VLAN interfaces 1000 times in 47 seconds.
74.20user 257.83system 6:04.46elapsed 91%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (2821122major+677782minor)pagefaults 0swaps
***********************************************************************
This is with the patch enabled: (2.4.0 + VLAN patch) (run 1)
***********************************************************************
[root@candle /root]# time vlan_test.pl
Adding VLAN interfaces 1 through 4000
Done adding 4000 VLAN interfaces in 83 seconds.
Doing ifconfig -a
10.61user 10.22system 0:23.43elapsed 88%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (117major+423minor)pagefaults 0swaps
Removing VLAN interfaces 1 through 4000
Done deleting 4000 VLAN interfaces in 64 seconds.
Going to add and remove 2 interfaces 1000 times.
Done adding/removing 2 VLAN interfaces 1000 times in 47 seconds.
73.69user 120.69system 3:44.10elapsed 86%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (2821122major+677782minor)pagefaults 0swaps
***********************************************************************
This is with the patch enabled: (2.4.0 + VLAN patch) (run 2)
***********************************************************************
[root@candle /root]# time vlan_test.pl
Adding VLAN interfaces 1 through 4000
Done adding 4000 VLAN interfaces in 80 seconds.
Doing ifconfig -a
10.62user 6.31system 0:18.63elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (117major+423minor)pagefaults 0swaps
Removing VLAN interfaces 1 through 4000
Done deleting 4000 VLAN interfaces in 61 seconds.
Going to add and remove 2 interfaces 1000 times.
Done adding/removing 2 VLAN interfaces 4000 times in 47 seconds.
74.05user 114.93system 3:33.00elapsed 88%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (2821122major+677782minor)pagefaults 0swaps
>
> > Suppose I bind a raw socket to device vlan4001 (ie I have 4k in the list
> > before that one!!). Currently, that means a linear search on all devices,
> > right? In that extreme example, I would expect the hash to be very
> > useful.
>
> Nope, it doesn't. Raw binding works via IP addresses, and the IP address resolution
> works via the routing table, which is extensively hashed.
Ahh, I meant raw, like raw Ethernet. True, not used very often,
but I happen to have been using it lately :)
The original idea for the hashing came after I was severly chastised by a few
for even considering allowing 4000 VLAN Interfaces into the kernel. The
complaint was that somehow having lots of devices was going to hurt performance.
The eventual conclusion (by me at least), was that there were no linear
lookups in any critical path I could think of. However, things like
binding to interfaces, and searching for them (ifconfig -i vlan3999),
were doing (at least) linear searching, so hashing it might make the
user happier.
>
> Packet socket binding or SO_BINDTODEVICE will search the list, but it is unlikely
> that these paths are worth optimizing for.
The patch has been written, so even if it helps just a little more than it
hurts, it might be worth including. Of course, it may actually hurt more
than help.
I'd be very interested in lucid arguments as to why adding the patch would
actually be worse than not adding it, not just why I'm lame for considering
it *grin* :)
--
Ben Greear (greearb@candelatech.com) http://www.candelatech.com
Author of ScryMUD: scry.wanfear.com 4444 (Released under GPL)
http://scry.wanfear.com http://scry.wanfear.com/~greear
[-- Attachment #2: vlan_test.pl --]
[-- Type: application/x-perl, Size: 1510 bytes --]
next prev parent reply other threads:[~2001-01-07 7:08 UTC|newest]
Thread overview: 77+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-01-06 21:33 [PATCH] hashed device lookup (Does NOT meet Linus' sumission policy!) Ben Greear
2001-01-06 23:17 ` David S. Miller
2001-01-07 4:06 ` Ben Greear
2001-01-07 5:36 ` David S. Miller
2001-01-07 13:42 ` [PATCH] hashed device lookup (Does NOT meet Linus' sumission Alan Cox
2001-01-07 15:33 ` Matti Aarnio
2001-01-07 16:46 ` Alan Cox
2001-01-07 17:32 ` Matti Aarnio
2001-01-07 19:02 ` Ben Greear
2001-01-07 18:06 ` Alan Cox
2001-01-07 18:53 ` Matti Aarnio
2001-01-07 19:30 ` Ben Greear
2001-01-07 18:30 ` Alan Cox
2001-01-07 22:40 ` 5116
2001-01-08 2:19 ` David Ford
2001-01-09 20:25 ` Christopher E. Brown
2001-01-10 2:47 ` Ben Greear
2001-01-07 18:21 ` jamal
2001-01-07 19:00 ` Matti Aarnio
2001-01-07 19:10 ` jamal
2001-01-07 19:24 ` Matti Aarnio
2001-01-08 0:21 ` jamal
2001-01-07 19:37 ` Ben Greear
2001-01-07 18:53 ` jamal
2001-01-07 3:29 ` [PATCH] hashed device lookup (Does NOT meet Linus' sumission policy!) Chris Wedgwood
2001-01-07 5:40 ` David S. Miller
2001-01-07 6:15 ` Ben Greear
2001-01-07 10:22 ` David Ford
2001-01-07 12:13 ` Chris Wedgwood
2001-01-07 12:01 ` David S. Miller
2001-01-08 5:32 ` Andi Kleen
2001-01-08 6:12 ` Chris Wedgwood
2001-01-08 6:26 ` Andi Kleen
2001-01-08 6:57 ` David Ford
2001-01-08 13:08 ` jamal
2001-01-09 13:28 ` Blu3Viper
2001-01-08 6:13 ` Blu3Viper
2001-01-07 12:19 ` David Ford
2001-01-07 16:56 ` jamal
2001-01-07 17:37 ` Gleb Natapov
2001-01-07 18:02 ` routable interfaces WAS( " jamal
2001-01-07 19:21 ` routable interfaces WAS( Re: [PATCH] hashed device lookup (DoesNOT " Ben Greear
2001-01-07 18:29 ` jamal
2001-01-07 18:51 ` Gleb Natapov
2001-01-07 19:05 ` jamal
2001-01-07 19:19 ` routable interfaces WAS( Re: [PATCH] hashed device lookup(DoesNOT " Sandy Harris
2001-01-07 20:42 ` Ben Greear
2001-01-08 0:37 ` jamal
2001-01-08 5:25 ` routable interfaces WAS( Re: [PATCH] hashed device lookup(DoesNOTmeet " Ben Greear
2001-01-08 13:05 ` jamal
2001-01-07 3:29 ` [PATCH] hashed device lookup (Does NOT meet " Andi Kleen
2001-01-07 4:00 ` jamal
2001-01-07 4:06 ` Andi Kleen
2001-01-07 5:43 ` David S. Miller
2001-01-07 11:40 ` [little bit OT] ip _IS_ _NOT_ ifconfig and route ! (was Re: [PATCH] hashed device lookup (Does NOT meet Linus' sumission policy!)) Henning P. Schmiedehausen
2001-01-07 11:50 ` David S. Miller
2001-01-07 13:47 ` [PATCH] hashed device lookup (Does NOT meet Linus' sumission Alan Cox
2001-01-07 16:12 ` jamal
2001-01-07 16:51 ` Alan Cox
2001-01-07 15:56 ` [PATCH] hashed device lookup (Does NOT meet Linus' sumission policy!) jamal
2001-01-07 16:30 ` Gleb Natapov
2001-01-07 16:36 ` jamal
2001-01-07 19:54 ` [PATCH] hashed device lookup (Does NOT meet Linus' sumissionpolicy!) Ben Greear
2001-01-07 6:24 ` Ben Greear
2001-01-07 5:29 ` Andi Kleen
2001-01-07 6:22 ` [PATCH] hashed device lookup (Does NOT meet Linus' sumission policy!) Ben Greear
2001-01-07 5:27 ` Andi Kleen
2001-01-07 8:11 ` Ben Greear [this message]
2001-01-07 7:15 ` [PATCH] hashed device lookup (Does NOT meet Linus' sumission policy!) (Benchmarks) Andi Kleen
2001-01-08 8:12 ` [PATCH] hashed device lookup (New Benchmarks) Ben Greear
2001-01-08 7:00 ` David S. Miller
2001-01-08 16:26 ` Ben Greear
2001-01-08 16:50 ` Andi Kleen
2001-01-09 16:27 ` Ben Greear
2001-01-07 13:50 ` [PATCH] hashed device lookup (Does NOT meet Linus' sumission Alan Cox
2001-01-07 16:44 ` Miquel van Smoorenburg
2001-01-07 19:09 ` Ben Greear
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=3A58249F.86DD52BC@candelatech.com \
--to=greearb@candelatech.com \
--cc=ak@suse.de \
--cc=davem@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@oss.sgi.com \
/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