From: Matthew Wilcox <matthew@wil.cx>
To: Arnaldo Carvalho de Melo <acme@mandriva.com>
Cc: "James E.J. Bottomley" <James.Bottomley@SteelEye.com>,
Andrew Morton <akpm@osdl.org>,
linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH][SCSI]: Save some bytes in struct scsi_target
Date: Mon, 11 Dec 2006 20:52:22 -0700 [thread overview]
Message-ID: <20061212035221.GF21070@parisc-linux.org> (raw)
In-Reply-To: <20061212031718.GC6218@mandriva.com>
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.
next prev parent reply other threads:[~2006-12-12 3:52 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-12-12 3:17 [PATCH][SCSI]: Save some bytes in struct scsi_target Arnaldo Carvalho de Melo
2006-12-12 3:52 ` Matthew Wilcox [this message]
2006-12-12 4:17 ` Arnaldo Carvalho de Melo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20061212035221.GF21070@parisc-linux.org \
--to=matthew@wil.cx \
--cc=James.Bottomley@SteelEye.com \
--cc=acme@mandriva.com \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.