simple memory malloc and free in ip_output.c

Mulyadi Santosa mulyadi.santosa at gmail.com
Tue Jan 7 06:27:04 EST 2014


On Fri, Jan 3, 2014 at 12:42 AM, Guibin(Bill) Tian <gbtian at gmail.com> wrote:
> Thank you sirs. But in fact, I don't alloc/free for every packet. I did
> exactly as what you said---reuse.
>
> I am a little confused why GFP_ATOMIC can work but GFP_KERNEL will cause the
> system to panic.  Does it because that GFP_KERNEL can sleep in kmalloc, then
> ip_xmit_queue will be held or something? But anyway, GFP_ATOMIC works
> perfectly.

yup, you nailed it. gfp_kernel sleeps, while ip_xmit_queue is in
interrupt context.


-- 
regards,

Mulyadi Santosa
Freelance Linux trainer and consultant

blog: the-hydra.blogspot.com
training: mulyaditraining.blogspot.com



More information about the Kernelnewbies mailing list