Hello!
> Surely there are no critical paths that access the list linearly???
All the places where result of device lookup is not cached.
IP tries to cache it, but not everywhere.
I am sorry, when list of thousands elements is scanned and strcmp()ed,
it is visible even in not very critical paths.
> If that is the problem, then those should be fixed, based on the
> device index or some other hash.
Exactly. Only it is more clever to avoid clogging system with devices,
when they are not necessary really. List is ideal in this case.
> What resources, other than memory, would the VLANs consume? I'm willing
> to pay memory for constant-time lookups.
8)8)8) You lose both in this case.
So, either you tell that list of devices must fit to single screen,
or you hide them skillfully, so that nobody ever saw them
occasionally and user doing "ifconfig" always saw some finite list.
> interfaces use pseudo-devices, what about Frame-Relay PVCs? ATM PVCs?
I remember, we have already talked about this. Do you remember? (NBMA 8))
Look, someone could find some merits in assigning special "eth666"
to each MAC address on the wire. People do not make this usually.
Why? Because it is inconvenient! When some amount exceeds dozen,
it must be hidden and some classification scheme more reasonable
than "xxxNNNNN" (f.e. given by dev_alloc_name()) must be used.
That's why dev_alloc_name() is limited to two digits.
And the maximum is not 99, as people extending it to 999 think,
but 15. (When output of "ip link ls" still fits to one screen 8)8))
Alexey
|