2002-09-26 21:15:33

by Manfred Spraul

[permalink] [raw]
Subject: Re: alloc_skb cannot be called with GFP_DMA

--- 2.5/mm/slab.c Sun Sep 22 06:25:17 2002
+++ build-2.5/mm/slab.c Thu Sep 26 23:02:40 2002
@@ -1259,6 +1259,13 @@

static inline void kmem_cache_alloc_head(kmem_cache_t *cachep, int flags)
{
+#if DEBUG
+ /* check if someone calls us from interrupt with GFP_WAIT set
+ * With debug disabled, this only happens in kmem_cache_grow,
+ * to reduce the critical path length.
+ */
+ if (in_interrupt() && (flags & __GFP_WAIT))
+ BUG();
if (flags & SLAB_DMA) {
if (!(cachep->gfpflags & GFP_DMA))
BUG();
@@ -1266,6 +1273,7 @@
if (cachep->gfpflags & GFP_DMA)
BUG();
}
+#endif
}

static inline void * kmem_cache_alloc_one_tail (kmem_cache_t *cachep,


Attachments:
patch-slab-debug (668.00 B)