RE: [PATCH 31/68] uas: Pack iu struct definitions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> It doesn't look like the networking subsystem (which seems to be the
> code you're most familiar with) uses packed, but plenty of other
> subsystems do.

I'm necessarily trying to change the world here :-) But ...

I suspect a few places have got caught out where 32bit values
get 16bit aligned and 64bit values are only 32bit aligned.
eg the x86 bios partition table and (IIRC) some scsi commands.

There are also many places where C structures are used to map
device registers (for memory mapped access) - these must be
marked 'packed'.

There are also small (and probably measurable in some network
benchmark) unnecessary costs in marking items 'packed' on systems
where unaligned accesses aren't supported.
The networking stack goes to great lengths to avoid misaligned
buffers. AFAICT very few of the 'packed' structures in the usb
headers will ever get misaligned.

Even if a structure has (say) a 64bit item that is only 32bit
aligned then the single field can be given an alignment attribute
so that two 32bit accesses are generated - rather than the eight
8bit ones that 'packed' required.

	David



--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux