From owner-freebsd-hackers Fri Jul 13 12:38:56 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from ussenterprise.ufp.org (ussenterprise.ufp.org [208.185.30.210]) by hub.freebsd.org (Postfix) with ESMTP id 363EB37B403 for ; Fri, 13 Jul 2001 12:38:53 -0700 (PDT) (envelope-from bicknell@ussenterprise.ufp.org) Received: (from bicknell@localhost) by ussenterprise.ufp.org (8.11.1/8.11.1) id f6DJcqM30000; Fri, 13 Jul 2001 15:38:52 -0400 (EDT) (envelope-from bicknell) Date: Fri, 13 Jul 2001 15:38:52 -0400 From: Leo Bicknell To: Leo Bicknell Cc: freebsd-hackers@FreeBSD.ORG Subject: Re: Network performance roadmap. Message-ID: <20010713153852.A29816@ussenterprise.ufp.org> Mail-Followup-To: Leo Bicknell , Leo Bicknell , freebsd-hackers@FreeBSD.ORG References: <20010713101107.B9559@ussenterprise.ufp.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20010713101107.B9559@ussenterprise.ufp.org>; from bicknell@ufp.org on Fri, Jul 13, 2001 at 10:11:07AM -0400 Organization: United Federation of Planets Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Fri, Jul 13, 2001 at 10:11:07AM -0400, Leo Bicknell wrote: > c - Prevent MBUF exhaustion. Today, when you run out of MBUF's, bad > things start to happen. It would be nice to prevent that from > happening, and also to provide sysadmins some warning when it is > about to happen. So I dug through some code, and this really seems to only be in one place (which surprises me a bit). In uipc_socket.c, line 525 there's a call like this: space = sbspace(&so->so_snd); To get the free space available, which is then used to determine if the process should be blocked or not. In uipc_mbuf.c, there is a global structure, "mbstat" that seems to keep the information we need. Modulo making the variables available, what it seems is needed is right after the call above: if (mbstat.clfree < (0.1 * mbstat.clusters)) { size = 0; } Of course you would want to do this with all integer math, and the right interface to get at those variables is needed. But it seems that would block senders before the system runs out of clusters, allowing things to drain and keeping clusters free for receivers. Adding in a 'printf("Low on mbuf's.")' type message would of course be good as well. Is it really this easy, or have I just missed the boat? -- Leo Bicknell - bicknell@ufp.org Systems Engineer - Internetworking Engineer - CCIE 3440 Read TMBG List - tmbg-list-request@tmbg.org, www.tmbg.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message