DragonFly BSD
DragonFly kernel List (threaded) for 2004-04
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Re: mbuf leak

From: Matthew Dillon <dillon@xxxxxxxxxxxxxxxxxxxx>
Date: Fri, 16 Apr 2004 15:08:05 -0700 (PDT)

    Try this patch.  I'll commit a cleaned up version of this in an hour
    or two after I finish testing it, since it's definitely a bug.  Eventually
    we will have to replace the malloc with an MPIPE allocator to guarentee
    that no deadlocks can happen.

    I think it may be the cause of the mbuf leak as well because
    netisr_dispatch() doesn't check netisr_queue()'s return value.  There
    are unfortunately a lot of M_NOWAIT uses in the network code, I'm going
    to have to go through and check each one.


Index: net/netisr.c
RCS file: /cvs/src/sys/net/netisr.c,v
retrieving revision 1.11
diff -u -r1.11 netisr.c
--- net/netisr.c	9 Apr 2004 22:34:09 -0000	1.11
+++ net/netisr.c	16 Apr 2004 22:07:33 -0000
@@ -101,7 +101,7 @@
 	return (EIO);
     /* use better message allocation system with limits later XXX JH */
-    if (!(pmsg = malloc(sizeof(struct netmsg_packet), M_LWKTMSG, M_NOWAIT)))
+    if (!(pmsg = malloc(sizeof(struct netmsg_packet), M_LWKTMSG, M_WAITOK)))
 	return (ENOBUFS);
     lwkt_initmsg_rp(&pmsg->nm_lmsg, &netisr_afree_rport, CMD_NETMSG_NEWPKT);

[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]