Re: alloc_skb cannot be called with GFP_DMA

Andrea Arcangeli (andrea@suse.de)
Sun, 5 Aug 2001 20:38:10 +0200


On Sun, Aug 05, 2001 at 09:18:11PM +0400, kuznet@ms2.inr.ac.ru wrote:
> Hello!
>
> > alloc_isa_skb will avoid to slowdown alloc_skb so I prefer it compared
> > to hiding the logic inside alloc_skb.
>
> Stop! This is redundant. GFP_DMA is for skb data, not head!
>
> So that, it is enough and right to clear GFP_DMA inside
> alloc_skb when allocating skb head.

ah it's all metadata, so this should fix it (the bugcheck will still
trap any skb_clone caller that uses GFP_DMA because it doesn't make
sense to call skb_clone with GFP_DMA):

--- 2.4.8pre4aa1/net/core/skbuff.c.~1~ Sat Jul 21 00:04:34 2001
+++ 2.4.8pre4aa1/net/core/skbuff.c Sun Aug 5 20:30:00 2001
@@ -180,7 +180,7 @@
/* Get the HEAD */
skb = skb_head_from_pool();
if (skb == NULL) {
- skb = kmem_cache_alloc(skbuff_head_cache, gfp_mask);
+ skb = kmem_cache_alloc(skbuff_head_cache, gfp_mask & ~__GFP_DMA);
if (skb == NULL)
goto nohead;
}

Andrea
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/