David S. Miller a écrit :
From: Eric Dumazet <[EMAIL PROTECTED]>
Date: Wed, 08 Feb 2006 00:23:45 +0100
Some devices are *never* unregistered : loopback, or statically linked
drivers, thus we are refcounting them for nothing.
Statically linked drivers can have netdev's that get unregistered
and free'd up. For example we have a few cases where configuration
calls allocate/register and deallocate/unregister net devices.
Yes, e1000 currently does this, and I actually am using this patch on a
machine with a e1000 card : I didnt change e1000 source.
I understand what you're trying to do, but I don't think this is
the way to do it.
I once thought we could play some games because of the invariant that
if we have a route attached to the SKB, that holds an implicit
reference for the netdevice too. But I know there are cases where
the the route attached to the SKB is to a different device than the
one that skb->dev is and should be set to.
There is also a temptation to deal with this using per-cpu (or
per-node) counters, and that's a too bloated solution. We should
be making datastructures smaller not larger.
Yes, I played with a structure I called a llref (Long Lived Reference count),
that is suitable for netdevice refcount and struct vfsmount 'refcnt'
It uses a per cpu local_t, but current implementation of alloc_percpu(local_t)
uses at least 32 bytes per cpu...
(sock_mnt, mqueue_mnt, shm_mnt, pipe_mnt, inotify_mnt, bd_mnt, devpts_mnt) are
another examples of objects having unecessary refcounters.
-
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