Re: ZONE_PADDING wastes 4 bytes of the new cacheline

Nick Piggin
2004-10-21T05:02:49Z

Andrew Morton wrote:
> 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
>
>

Wow. You'd probably still want pad1 because that seperates the
allocator and the scanner. It looks like temp/prev_priority
should be _above_ pad2, and possibly free_area should be above
pad1.

Don't know about all the stuff below pad3.