David S. Miller wrote:
From: Ben Greear <[EMAIL PROTECTED]>
Date: Sat, 27 Aug 2005 11:19:24 -0700
Although my implementation is not there yet, it would be nice if we
could use the address of the pointer than holds the dev reference
as the key. We should then be able to also catch double dereferences
and places where the same pointer is used to hold two references at
the same time (ie, forgot to drop the old ref before adding the new.)
You make some good points, let me think about it.
One worrysome spot is the case where multiple references
from a single client are legal. I can't think of any such
cases here, but it's something to at least consider.
In the current code, there are several places where we do a call to
dev_hold before the dev_free is called. The code is correct, as far
as I can tell, but I think it could be re-ordered so that the dev_put is
done before the dev_hold (the ipv4 code that deals with loopback device
comes to mind.)
Another problem is stack variables. I don't think the addresses of
stack variables are as unique as addresses of things on the heap. Might
could take the CPU-ID into account for re-entrant methods or something
like that to get a unique key...
Might could just special case these trouble spots and ignore certain
errors and still get benefit of the places where we do have good unique
keys though...
Ben
--
Ben Greear <[EMAIL PROTECTED]>
Candela Technologies Inc http://www.candelatech.com
-
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