[PATCH 8/14] ps3: bind interrupt to cpu

Arnd Bergmann arnd at arndb.de
Thu Jan 25 17:19:40 EST 2007


On Thursday 25 January 2007 03:40, Geoff Levand wrote:
> +struct ps3_bmp {
> +       struct {
> +               unsigned long status;
> +               unsigned long unused_1[3];
> +               unsigned long mask;
> +               unsigned long unused_2[3];
> +       } __attribute__ ((aligned (64)));
> +
> +       spinlock_t lock;
> +       unsigned long ipi_debug_brk_mask;
> +};
> +
> +struct ps3_private {
> +       struct ps3_bmp bmp;
> +       unsigned long node;
> +       unsigned 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 <><



More information about the Linuxppc-dev mailing list