Re: [patch 4/6] slub: avoid compiling SLAB_CACHE_DMA without DMAsupport

From: David Rientjes
Date: Wed May 25 2011 - 19:34:59 EST


On Wed, 25 May 2011, Christoph Lameter wrote:

> > If CONFIG_ZONE_DMA is disabled, SLAB_CACHE_DMA is a no-op. Avoid
> > compiling support for it on such a configuration.
>
> Setting SLAB_CACHE_DMA to zero in the !ZONE_DMA case could avoid some of
> the ifdeffery.
>

That doesn't actually accomplish anything since all SLAB_CACHE_DMA does is
set SLUB_DMA, which is already 0 in slub_def.h without CONFIG_ZONE_DMA:

#ifdef CONFIG_ZONE_DMA
#define SLUB_DMA __GFP_DMA
#else
/* Disable DMA functionality */
#define SLUB_DMA (__force gfp_t)0
#endif

So doing the same for SLAB_CACHE_DMA wouldn't do anything. The point of
the patchset is to break the build if SLAB_CACHE_DMA is passed to
kmem_cache_create() and the kernel is not compiled for DMA support. That
should result in a build breakage rather than silently not supporting DMA
slab caches since it needs to be corrected at build.
--
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/