Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 13 Jul 2001 15:38:52 -0400
From:      Leo Bicknell <bicknell@ufp.org>
To:        Leo Bicknell <bicknell@ufp.org>
Cc:        freebsd-hackers@FreeBSD.ORG
Subject:   Re: Network performance roadmap.
Message-ID:  <20010713153852.A29816@ussenterprise.ufp.org>
In-Reply-To: <20010713101107.B9559@ussenterprise.ufp.org>; from bicknell@ufp.org on Fri, Jul 13, 2001 at 10:11:07AM -0400
References:  <20010713101107.B9559@ussenterprise.ufp.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010713153852.A29816>