From owner-freebsd-questions Mon May 3 19:30:51 1999 Delivered-To: freebsd-questions@freebsd.org Received: from implode.root.com (root.com [209.102.106.178]) by hub.freebsd.org (Postfix) with ESMTP id 7781015766 for ; Mon, 3 May 1999 19:30:37 -0700 (PDT) (envelope-from root@implode.root.com) Received: from implode.root.com (localhost [127.0.0.1]) by implode.root.com (8.8.8/8.8.5) with ESMTP id TAA05263; Mon, 3 May 1999 19:27:05 -0700 (PDT) Message-Id: <199905040227.TAA05263@implode.root.com> To: Bryce Newall Cc: Doug White , FreeBSD Questions List Subject: Re: No buffer space In-reply-to: Your message of "Mon, 03 May 1999 19:43:29 MDT." From: David Greenman Reply-To: dg@root.com Date: Mon, 03 May 1999 19:27:05 -0700 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG >On Mon, 3 May 1999, Doug White wrote: > >> What does 'netsat -m' report? > >Right now, it's reporting: > >[51]data@calico:/home/data % netstat -m >3929/4544 mbufs in use: > 1528 mbufs allocated to data > 2401 mbufs allocated to packet headers >1389/1696/6000 mbuf clusters in use (current/peak/max) >3960 Kbytes allocated to network (82% in use) >0 requests for memory denied >0 requests for memory delayed What does "sysctl vm.zone" report for "socket"? If USED+FREE is at or near the LIMIT, then you're seeing the effects of a socket leak that I found yesterday. The attached patches back out the changes that caused the leak. -DG David Greenman Co-founder/Principal Architect, The FreeBSD Project - http://www.freebsd.org Creator of high-performance Internet servers - http://www.terasolutions.com Index: uipc_socket.c =================================================================== RCS file: /home/ncvs/src/sys/kern/uipc_socket.c,v retrieving revision 1.51.2.1 diff -c -r1.51.2.1 uipc_socket.c *** uipc_socket.c 1999/02/26 17:32:49 1.51.2.1 --- uipc_socket.c 1999/05/02 22:41:40 *************** *** 193,210 **** TAILQ_REMOVE(&head->so_incomp, so, so_list); head->so_incqlen--; } else if (so->so_state & SS_COMP) { ! /* ! * We must not decommission a socket that's ! * on the accept(2) queue. If we do, then ! * accept(2) may hang after select(2) indicated ! * that the listening socket was ready. ! */ ! return; } else { panic("sofree: not queued"); } head->so_qlen--; ! so->so_state &= ~SS_INCOMP; so->so_head = NULL; } sbrelease(&so->so_snd); --- 193,204 ---- TAILQ_REMOVE(&head->so_incomp, so, so_list); head->so_incqlen--; } else if (so->so_state & SS_COMP) { ! TAILQ_REMOVE(&head->so_comp, so, so_list); } else { panic("sofree: not queued"); } head->so_qlen--; ! so->so_state &= ~(SS_INCOMP|SS_COMP); so->so_head = NULL; } sbrelease(&so->so_snd); *************** *** 234,244 **** } for (sp = so->so_comp.tqh_first; sp != NULL; sp = sonext) { sonext = sp->so_list.tqe_next; - /* Dequeue from so_comp since sofree() won't do it */ - TAILQ_REMOVE(&so->so_comp, sp, so_list); - so->so_qlen--; - sp->so_state &= ~SS_COMP; - sp->so_head = NULL; (void) soabort(sp); } } --- 228,233 ---- *************** *** 299,311 **** if ((so->so_state & SS_NOFDREF) == 0) panic("soaccept: !NOFDREF"); so->so_state &= ~SS_NOFDREF; ! if ((so->so_state & SS_ISDISCONNECTED) == 0) ! error = (*so->so_proto->pr_usrreqs->pru_accept)(so, nam); ! else { ! if (nam) ! *nam = 0; ! error = 0; ! } splx(s); return (error); } --- 288,294 ---- if ((so->so_state & SS_NOFDREF) == 0) panic("soaccept: !NOFDREF"); so->so_state &= ~SS_NOFDREF; ! error = (*so->so_proto->pr_usrreqs->pru_accept)(so, nam); splx(s); return (error); } To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message