Re: ZONE_PADDING wastes 4 bytes of the new cacheline

Andrew Morton
2004-10-21T04:47:34Z

Nick Piggin <nickpiggin@yahoo.com.au> wrote:
>
> > #if defined(CONFIG_SMP)
> > struct zone_padding {
> > - int x;
> > } ____cacheline_maxaligned_in_smp;
> > #define ZONE_PADDING(name) struct zone_padding name;
> > #else
>
> Perhaps to keep old compilers working? Not sure.

gcc-2.95 is OK with it.

Stock 2.6.9:

sizeof(struct zone) = 1920

With Andrea's patch:

sizeof(struct zone) = 1536

With ZONE_PADDING removed:

sizeof(struct zone) = 1408