Re: [patch] x86: allow ZONE_DMA to be configurable

From: David Rientjes
Date: Fri Oct 15 2010 - 05:09:48 EST


On Thu, 14 Oct 2010, Andrew Morton wrote:

> > We've run with it for a couple years, we can even undefine __GFP_DMA to
> > find allocations that we compile into the kernel to ensure we don't have a
> > requirement for the zone.
>
> "we" is google, I assume.
>

Yes.

> > Perhaps only define the gfp flag when we have
> > CONFIG_ZONE_DMA and break users' builds until they disable options that
> > require it
>
> That sounds a good idea.
>
> What happens in the current patch if someone passes __GFP_DMA when
> CONFIG_ZONE_DMA=n? ENOMEM? Perhaps it should WARN() as well.
>

It'll return NULL and I suggested adding a

#ifndef CONFIG_ZONE_DMA
if (WARN_ON_ONCE(gfp_mask & __GFP_DMA))
return NULL;
#endif

up front in the slowpath.

> hm. It'd be better to make all the drivers depend on ZONE_DMA. Good
> luck with that :)
>

If they all truly depended on it then we'd never have been able to disable
it. I think breaking the build when you have CONFIG_ZONE_DMA=n and
something is passing GFP_DMA would be the best alternative.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/