Re: [RFC 4/8] page allocator: Optional ZONE_DMA

Andi Kleen
2006-07-08T00:23:25Z

On Saturday 08 July 2006 02:05, Christoph Lameter wrote:
> Make ZONE_DMA optional in the page allocator

Hmm, we should rename you the "ifdef warrior"

> - ifdef all code for ZONE_DMA and related definition
>
> - Without ZONE_DMA, ZONE_HIGHMEM and ZONE_DMA32 we fall back
> to an empty GFP_ZONEMASK and a ZONES_SHIFT of zero (since there
> is only one zone....).
>
> - We need to fix the use of ZONE_DMA in the memory policy layer.
> ZONE_DMA is used there as the first zone so use 0 instead.

Is the barely better code really worth all the ugliness from the ifdefs? I have doubts.

I think your idea of saving some cache lines by not having the unused
zones in the fallback lists etc. is a good one, but your current implementation
with its ifdef maze is extremly ugly. Surely this can be a done less
intrusively?

-Andi