[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.00.1105241652110.29780@chino.kir.corp.google.com>
Date: Tue, 24 May 2011 16:53:52 -0700 (PDT)
From: David Rientjes <rientjes@...gle.com>
To: Pekka Enberg <penberg@...nel.org>
cc: Christoph Lameter <cl@...ux.com>, linux-kernel@...r.kernel.org
Subject: [patch 4/6] slub: avoid compiling SLAB_CACHE_DMA without DMA
support
If CONFIG_ZONE_DMA is disabled, SLAB_CACHE_DMA is a no-op. Avoid
compiling support for it on such a configuration.
Signed-off-by: David Rientjes <rientjes@...gle.com>
---
mm/slub.c | 9 ++++++++-
1 files changed, 8 insertions(+), 1 deletions(-)
diff --git a/mm/slub.c b/mm/slub.c
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -162,7 +162,10 @@ static inline int kmem_cache_debug(struct kmem_cache *s)
SLAB_FAILSLAB)
#define SLUB_MERGE_SAME (SLAB_DEBUG_FREE | SLAB_RECLAIM_ACCOUNT | \
- SLAB_CACHE_DMA | SLAB_NOTRACK)
+# ifdef CONFIG_ZONE_DMA
+ SLAB_CACHE_DMA | \
+# endif
+ SLAB_NOTRACK)
#define OO_SHIFT 16
#define OO_MASK ((1 << OO_SHIFT) - 1)
@@ -2544,8 +2547,10 @@ static int calculate_sizes(struct kmem_cache *s, int forced_order)
if (order)
s->allocflags |= __GFP_COMP;
+#ifdef CONFIG_ZONE_DMA
if (s->flags & SLAB_CACHE_DMA)
s->allocflags |= SLUB_DMA;
+#endif
if (s->flags & SLAB_RECLAIM_ACCOUNT)
s->allocflags |= __GFP_RECLAIMABLE;
@@ -4651,8 +4656,10 @@ static char *create_unique_id(struct kmem_cache *s)
* are matched during merging to guarantee that the id is
* unique.
*/
+#ifdef CONFIG_ZONE_DMA
if (s->flags & SLAB_CACHE_DMA)
*p++ = 'd';
+#endif
if (s->flags & SLAB_RECLAIM_ACCOUNT)
*p++ = 'a';
if (s->flags & SLAB_DEBUG_FREE)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists