Re: [PATCH] Driver Core update for 2.6.4

From: Greg KH
Date: Tue Mar 16 2004 - 14:48:34 EST


On Tue, Mar 16, 2004 at 05:14:47PM +0100, Andi Kleen wrote:
> Andrew Morton <akpm@xxxxxxxx> writes:
> >
> > eh? If there is any argument against this code it is that it is so simple
> > that the thing which it abstracts is not worth abstracting. But given that
> > it is so unwasteful, this seems unimportant.
>
> The bloat argument was about the additional pointer in the dynamic
> data structure (on a 64bit architecture it costs 12 bytes)

Well balance that out against every usb driver re-implemeting the same
get/put logic with an atomic counter and that "bloat of a pointer" just
got lost in the noise of the extra kernel code size increase :)

> Better would be to pass the callback to kref_put(), but then it would
> be even better to just test the return value (callbacks are obfuscation
> and should be avoided when not needed)

You don't always have the same chunk of code doing the last kref_put()
as the one where we know the release function is at. See the
kobject/driver model code for an example of this.

thanks,

greg k-h
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/