Re: Debug: sleeping function called from invalid context at mm/slab.c:2126
From: Parag Warudkar (kernel-stuff_at_comcast.net)
Date: 11/10/05
- Previous message: Andrew Morton: "Re: [PATCH 10/15] mm: atomic64 page counts"
- Maybe in reply to: Tony: "Debug: sleeping function called from invalid context at mm/slab.c:2126"
- Next in thread: Tony: "Re: Debug: sleeping function called from invalid context at mm/slab.c:2126"
- Reply: Tony: "Re: Debug: sleeping function called from invalid context at mm/slab.c:2126"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
To: Tony <tony.uestc@gmail.com>, linux-kernel@vger.kernel.org Date: Thu, 10 Nov 2005 03:07:32 +0000
> I'm writing a net_device driver. I want to send a packet when the timer
> is out. I get the following warning. It seems that I should not call
> alloc_skb. Can anyone tell me how to get rid of this? Thanks in advance.
>
You are calling alloc_skb which in turn calls kmem_cache_alloc in interrupt context where things can't sleep and kmem_cache_alloc can sleep. The reason for this is that you are passing GFP_KERNEL to alloc_skb. Try passing GFP_ATOMIC instead.
Other alternative is to may be use a precreated pool of skbs - may be this can be done in driver init function or any other safe context. But I don't know how much feasible that is in your situation.
HTH
Parag
-
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/
- Previous message: Andrew Morton: "Re: [PATCH 10/15] mm: atomic64 page counts"
- Maybe in reply to: Tony: "Debug: sleeping function called from invalid context at mm/slab.c:2126"
- Next in thread: Tony: "Re: Debug: sleeping function called from invalid context at mm/slab.c:2126"
- Reply: Tony: "Re: Debug: sleeping function called from invalid context at mm/slab.c:2126"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|