* David S. Miller <[EMAIL PROTECTED]> 2005-07-25 16:18 > From: Thomas Graf <[EMAIL PROTECTED]> > Date: Tue, 26 Jul 2005 01:11:13 +0200 > > > Not sure but as I see it: > ... > > The __dev_get_by_index() can be expensive with > > more than a 1k interfaces but the hash generally > > does well so I don't see much of a problem. > > Whilst this does save us 4 bytes on 64-bit, I fear it will > be significantly more expensive to do things this way rather > than a device pointer and refcount held to the SKB. > > What do you think, relative cost wise?
Very hard to answer as long as I don't really know how much we'd actually gain by saving those 4 bytes. The ifindex route has a terrible worst case, e.g assuming someone has 2**16 interfaces we'd have to do a linear search over 256 device entries for every __kfree_skb(). Therefore I'd say stick to the device pointers for now to be on the safe side, in case we're missing a 4 bytes saving for cacheline reasons we can think about this again and defuse the worst case a bit by increasing NETDEV_HASHBITS. - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html