Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 6 Jan 2005 17:38:54 -0500
From:      Bosko Milekic <bmilekic@technokratis.com>
To:        Chris <chrcoluk@gmail.com>
Cc:        freebsd-stable@freebsd.org
Subject:   Re: mbufs on 5.3-STABLE possible bug
Message-ID:  <20050106223854.GA97444@technokratis.com>
In-Reply-To: <3aaaa3a0501060612502ce616@mail.gmail.com>
References:  <3aaaa3a0501060612502ce616@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help

--XsQoSWH+UP9D9v3l
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline


Please try the attached patch.  It's not exactly perfect but it might
solve your problem.  Let me know.

-Bosko

On Thu, Jan 06, 2005 at 02:12:33PM +0000, Chris wrote:
> Hi
> 
> After reading the release notes and upgrading my server's I had set
> the following in my /boot/loader.conf.
> 
> kern.ipc.nmbclusters="0"
> 
> This is supposed to make the limit to unlimited as I understood from
> the docs, but a user on one of my server's reported slow download
> speeds he was testing with wget and fetch, so we compared with another
> FreeBSD server (5.2.1) on the same network and sure enough there was a
> massive difference (45mbit on the other server 5mbit on mine), I spent
> ages checking all my tweaks and changes I made comparing between the 2
> server's and ended up checking my loader.conf and tried setting a
> value and leaving it as auto, both of these changes fixed the download
> speed issue but setting to "0" introduces the problem.
> 
> Has anyone else noticed this?
> 
> Chris
> _______________________________________________
> freebsd-stable@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-stable
> To unsubscribe, send any mail to "freebsd-stable-unsubscribe@freebsd.org"

-- 
Bosko Milekic
bmilekic@technokratis.com
bmilekic@FreeBSD.org

--XsQoSWH+UP9D9v3l
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="nmbclusters.diff"

Index: src/sys/kern/kern_mbuf.c
===================================================================
RCS file: /home/ncvs/src/sys/kern/kern_mbuf.c,v
retrieving revision 1.4
diff -u -r1.4 kern_mbuf.c
--- src/sys/kern/kern_mbuf.c	20 Sep 2004 08:52:04 -0000	1.4
+++ src/sys/kern/kern_mbuf.c	6 Jan 2005 22:37:34 -0000
@@ -1,5 +1,5 @@
 /*-
- * Copyright (c) 2004
+ * Copyright (c) 2004, 2005
  * 	Bosko Milekic <bmilekic@FreeBSD.org>.
  *	All rights reserved.
  *
@@ -85,13 +85,16 @@
 int nmbclusters;
 struct mbstat mbstat;
 
+static int nmbclusters2;
+
 static void
 tunable_mbinit(void *dummy)
 {
 
 	/* This has to be done before VM init. */
 	nmbclusters = 1024 + maxusers * 64;
-	TUNABLE_INT_FETCH("kern.ipc.nmbclusters", &nmbclusters);
+	nmbclusters2 = nmbclusters;
+	TUNABLE_INT_FETCH("kern.ipc.nmbclusters", &nmbclusters2);
 }
 SYSINIT(tunable_mbinit, SI_SUB_TUNABLES, SI_ORDER_ANY, tunable_mbinit, NULL);
 
@@ -141,8 +144,8 @@
 	    NULL, NULL, MSIZE - 1, UMA_ZONE_MAXBUCKET);
 	zone_clust = uma_zcreate("MbufClust", MCLBYTES, mb_ctor_clust,
 	    mb_dtor_clust, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_REFCNT);
-	if (nmbclusters > 0)
-		uma_zone_set_max(zone_clust, nmbclusters);
+	if (nmbclusters2 > 0)
+		uma_zone_set_max(zone_clust, nmbclusters2);
 	zone_pack = uma_zsecond_create("Packet", mb_ctor_pack, mb_dtor_pack,
 	    mb_init_pack, mb_fini_pack, zone_mbuf);
 

--XsQoSWH+UP9D9v3l--



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