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

David S. Miller (
Sat, 6 Jan 2001 21:40:36 -0800

On Sat, Jan 06, 2001 at 02:33:27PM -0700, Ben Greear wrote:

I'm hoping that I can get a few comments on this code. It was
added to (significantly) speed up things like 'ifconfig -a' when
running with 4000 or so VLAN devices. It should also help other
instances with lots of (virtual) devices, like FrameRelay, ATM,
and possibly virtual IP interfaces. It probably won't help
'normal' users much, and in it's final form, should probably be a
selectable option in the config process.

Ben, if ifconfig uses /proc/net/dev to list devices, how can your
changes speed up ifconfig? Andi mentioned in another email how he has
fixed the quadratic behavior in ifconfig, you should check if it fixes
your problem. Jamal has suggested dumping ifconfig and making a dummy
"ifconfig" which just wrappers around "ip". I like this idea the most.

Really, what I'm concerned about is what calls dev_get_by_{name,index}
so often and in such critical places that optimizing it makes any

I don't mind optimizing stuff like this where needed, in fact I'm the
most guilty of this, check out the complex TCP hash tables we have :-)
But if it's only a problem because of poorly implemented user
applications, let's fix the apps instead of adding the complexity to
the kernel.

David S. Miller
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
Please read the FAQ at