Re: [PATCH 27/32] scsi_data_buffer

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

 



On Oct. 18, 2007, 10:06 +0200, Matthew Wilcox <matthew@xxxxxx> 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 majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux