Re: [PATCH][SCSI]: Save some bytes in struct scsi_target

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

 



On Tue, Dec 12, 2006 at 01:17:18AM -0200, Arnaldo Carvalho de Melo wrote:
> }; /* size: 368, cachelines: 12 */
> }; /* size: 364, cachelines: 12 */

Saving space is always good ;-)

> -	unsigned int		create:1; /* signal that it needs to be added */
> +	char			scsi_level;
> +	unsigned char		create:1; /* signal that it needs to be added */
>  	unsigned int		pdt_1f_for_no_lun;	/* PDT = 0x1f */
>  						/* means no lun present */
>  
> -	char			scsi_level;

However, pdt_1f_for_no_lun is really only one bit, saving another 4 bytes.

>  	struct execute_work	ew;
>  	enum scsi_target_state	state;

enums are a bit of a pain.  Even though scsi_target_state uses only two
values, it's represented as an int.  Unless you're on arm-eabi, when
it'll use less.  And even then, it won't use less than a byte, as it has
to be addressable.  I wonder if we can turn scsi_target_state into a
bit.  That'll save another 8 bytes total.
-
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