On Oct. 18, 2007, 10:06 +0200, Matthew Wilcox <[EMAIL PROTECTED]> wrote:
> On Thu, Oct 18, 2007 at 08:59:58AM +0200, Benny Halevy wrote:
>> yeah. The sglist pointer shuffle makes sense and so are the field type
>> changes and coalescing, but the union holding the deprecated fields
>> of scsi_data_buff is going away.
> 
> Indeed.  We could always do ...
> 
>       union {
>               struct scsi_data_pointer;
>               struct {
>                       char _padding_[sizeof(struct scsi_data_pointer)];
>                       int result;
>               }
>       }
> 
> But that might set a new record of depths of obfuscation.

agreed :)

> 
>> #pragma pack(4) before struct scsi_cmnd
>> (followed by #pragma pack()) should do the trick 
>> by saving member padding bytes. As a general rule I don't like pragma's
>> but this one works, is easy to understand, and is pretty standard.
> 
> But it might well have the effect of pessimising accesses to the struct,
> and accesses to scsi_cmnd are pretty hot.  I've seen gcc revert to byte
> loads and stores to packed structs in the past.  Maybe it's got better
> now.
> 

that's why I suggested pack(4) and not pack(1), assuming 4-byte alignment
is still as efficient as 8-byte alignment on most common 64 bit architectures.
-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to