Re: GFP_ATOMIC vs GFP_KERNEL in netfilter module
From: Robert Love (rml_at_novell.com)
Date: 12/03/04
- Previous message: Alan Cox: "Re: A new home for LDD2"
- In reply to: Roberto Jung Drebes: "GFP_ATOMIC vs GFP_KERNEL in netfilter module"
- Next in thread: Roberto Jung Drebes: "Re: GFP_ATOMIC vs GFP_KERNEL in netfilter module"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
To: Roberto Jung Drebes <drebes@inf.ufrgs.br> Date: Thu, 02 Dec 2004 19:31:49 -0500
On Thu, 2004-12-02 at 21:12 -0200, Roberto Jung Drebes wrote:
> If I use GFP_KERNEL with the kmallocs, I get errors like
So don't use GFP_KERNEL; use GFP_ATOMIC. You cannot sleep in netfilter
hooks, since they are run in interrupt context (when the packet is
received) by the net_rx_action softirq. You can see this in your stack
trace.
> If I use GFP_ATOMIC, I don't get the error, but I think timers are not
> being called after the delay. I have a similar code for transmition,
> which works OK with GFP_KERNEL (delays messages) but with GFP_ATOMIC it
> does also not delay.
If you have problems with GFP_ATOMIC, the problem is elsewhere and not
in the fact that your allocations are atomic versus not.
First thing, though, check the return value from kmalloc for failure (dp
and tl equal NULL) to ensure that the allocation is even working!
Robert Love
-
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: Alan Cox: "Re: A new home for LDD2"
- In reply to: Roberto Jung Drebes: "GFP_ATOMIC vs GFP_KERNEL in netfilter module"
- Next in thread: Roberto Jung Drebes: "Re: GFP_ATOMIC vs GFP_KERNEL in netfilter module"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|