Driver Core update for 2.6.4
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 4 lines · Andrew Morton
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)
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)
-Andi
Quoted 8 lines · Andi Kleen
Quoted 4 lines · Andrew Morton
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 :)
Quoted 3 lines
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
Quoted 7 lines · Greg KH
Quoted 6 lines · Andi Kleen
Quoted 4 lines · Andrew Morton
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.
Quoted 5 lines
Quoted 2 lines
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
Yes, all those one and two liners duplicated ... scary.
Quoted 1 line
got lost in the noise of the extra kernel code size increase :)
Have you ever looked how many instructions
if (!atomic_dec_and_test(&foo->ref)) release(foo)
generated? Code size makes no difference here at all.
Dynamic object bloat is much worse than code bloat anyways because you can have thousands of these objects.
-Andi
Quoted 6 lines · Andi Kleen
Quoted 3 lines
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)
This is one place where C++-style vtable inheritance would help.
Many of those *_operations tables could logically derive from a kref_operations table.
I doubt if there is a nice to way to represent it with C macros, but maybe there is.
-- Jamie
Quoted 5 lines · Jamie Lokier
Quoted 4 lines · Andi Kleen
Quoted 3 lines
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.
Quoted 8 lines
Quoted 2 lines
The bloat argument was about the additional pointer in the dynamic data structure (on a 64bit architecture it costs 12 bytes)
This is one place where C++-style vtable inheritance would help.
Many of those*_operationstables could logically derive from akref_operationstable.I doubt if there is a nice to way to represent it with C macros, but maybe there is.
(Stupid idea) Has anybody thought about using "Lightweight C++"?
Signature · 7 lines
Giuseppe "Oblomov" Bilotta
Can't you see
It all makes perfect sense
Expressed in dollar and cents
Pounds shillings and pence
(Roger Waters)