Re: Possible msgsnd ATOMIC problem

David S. Miller (davem@jenolan.rutgers.edu)
Thu, 16 Oct 1997 17:16:22 -0400


Date: Thu, 16 Oct 1997 21:17:19 +0200
From: Pavel Machek <pavel@Elf.mj.gts.cz>

I found following code in msg.c

/* allocate message header and text space*/
msgh = (struct msg *) kmalloc (sizeof(*msgh) + msgsz,
GFP_ATOMIC);
~~~~~~~~~~

Should not this be (in_interrupt()?GFP_ATOMIC:GFP_KERNEL), or
(msgflg & IPC_KERNEL? ... )? I really do not think message queues
should eat valuable atomic memory.

I think you're right. If you look in include/net/ipv6.h, Pedro Roque
has this little inline called gfp_any(), that should be moved into a
generic header and used in cases like the one you are pointing out.

Later,
David "Sparc" Miller
davem@caip.rutgers.edu