From: Arnd Bergmann <arnd@arndb.de>
To: linuxppc-dev@ozlabs.org
Cc: paulus@samba.org
Subject: Re: [PATCH 8/14] ps3: bind interrupt to cpu
Date: Thu, 25 Jan 2007 07:19:40 +0100 [thread overview]
Message-ID: <200701250719.40808.arnd@arndb.de> (raw)
In-Reply-To: <45B8188A.5070900@am.sony.com>
On Thursday 25 January 2007 03:40, Geoff Levand wrote:
> +struct ps3_bmp {
> +=A0=A0=A0=A0=A0=A0=A0struct {
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0unsigned long status;
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0unsigned long unused_1[3];
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0unsigned long mask;
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0unsigned long unused_2[3];
> +=A0=A0=A0=A0=A0=A0=A0} __attribute__ ((aligned (64)));
> +
> +=A0=A0=A0=A0=A0=A0=A0spinlock_t lock;
> +=A0=A0=A0=A0=A0=A0=A0unsigned long ipi_debug_brk_mask;
> +};
> +
> +struct ps3_private {
> +=A0=A0=A0=A0=A0=A0=A0struct ps3_bmp bmp;
> +=A0=A0=A0=A0=A0=A0=A0unsigned long node;
> +=A0=A0=A0=A0=A0=A0=A0unsigned int cpu;
> +};
This layout has some unnecessary padding in it. It turns out as:
status
unused_1
mask
unused_2
lock
/* 4 bytes pad */
ipi_debug_brk_mask
/* 48 bytes pad */
node
cpu
which you probably did not indent.
If 'status' needs to be aligned by 64 bytes, you can better express
this as
struct ps3_bmp {
struct {
unsigned long status;
unsigned long unused_1[3];
unsigned long mask;
unsigned long unused_2[3];
};
unsigned long ipi_debug_brk_mask;
spinlock_t lock;
};
struct ps3_private {
struct ps3_bmp bmp __attribute__ ((aligned (64)));
unsigned long node;
unsigned int cpu;
};
which should reduce the size of your structure from 192 bytes to 64.
Arnd <><
next prev parent reply other threads:[~2007-01-25 6:19 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-01-25 2:40 [PATCH 8/14] ps3: bind interrupt to cpu Geoff Levand
2007-01-25 3:54 ` Benjamin Herrenschmidt
2007-01-26 1:29 ` Geoff Levand
2007-01-25 6:19 ` Arnd Bergmann [this message]
2007-01-25 13:32 ` Geert Uytterhoeven
2007-01-25 13:33 ` Geert Uytterhoeven
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=200701250719.40808.arnd@arndb.de \
--to=arnd@arndb.de \
--cc=linuxppc-dev@ozlabs.org \
--cc=paulus@samba.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.