netdev
[Top] [All Lists]

Re: [PATCH] hashed device lookup (Does NOT meet Linus' sumission policy!

To: Ben Greear <greearb@xxxxxxxxxxxxxxx>
Subject: Re: [PATCH] hashed device lookup (Does NOT meet Linus' sumission policy!)
From: Andi Kleen <ak@xxxxxxx>
Date: Sun, 7 Jan 2001 06:27:44 +0100
Cc: Andi Kleen <ak@xxxxxxx>, linux-kernel <linux-kernel@xxxxxxxxxxxxxxx>, "netdev@xxxxxxxxxxx" <netdev@xxxxxxxxxxx>
In-reply-to: <3A580B31.7998C783@xxxxxxxxxxxxxxx>; from greearb@xxxxxxxxxxxxxxx on Sat, Jan 06, 2001 at 11:22:41PM -0700
References: <3A578F27.D2A9DF52@xxxxxxxxxxxxxxx> <20010107042959.A14330@xxxxxxxxxxxxxxxxxxx> <3A580B31.7998C783@xxxxxxxxxxxxxxx>
Sender: owner-netdev@xxxxxxxxxxx
User-agent: Mutt/1.2.5i
On Sat, Jan 06, 2001 at 11:22:41PM -0700, Ben Greear wrote:
> At the time I was doing this, I downloaded the latest nettools version.
> The hashing made a very noticable difference on 4000 interfaces, but
> I haven't run any real solid benchmarkings at other levels.  Can
> you tell me some distinguishing mark (version?) on ifconfig that I
> can look for?

Just get the latest release.

> 
> 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) 

> 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.

Packet socket binding or SO_BINDTODEVICE will search the list, but it is 
unlikely
that these paths are worth optimizing for.


> Binding to IP addresses have the same issue??

No, uses the fib.

> Also, though hashing by name is not horribly exact, hashing on the device
> index should be nearly perfect, so finding device 666 might take a search
> through only 5 or so devices (find the hash-bucket, walk down the list in
> that bucket).

Just why? It is not in any critical path I can see at all. 


-Andi


<Prev in Thread] Current Thread [Next in Thread>