PERFORCE change 91580 for review
Peter Wemm
peter at FreeBSD.org
Sat Feb 11 10:26:23 PST 2006
http://perforce.freebsd.org/chv.cgi?CH=91580
Change 91580 by peter at peter_daintree on 2006/02/11 18:25:50
Try making the nmbclusters sysctl actually do something. Out of paranoia,
do not allow it to reduce the current value - ie: increase only. It would
probably work, but wouldn't be healthy to the network stack if we allowed it
to be run into the ground.
Affected files ...
.. //depot/projects/hammer/sys/kern/kern_mbuf.c#15 edit
Differences ...
==== //depot/projects/hammer/sys/kern/kern_mbuf.c#15 (text+ko) ====
@@ -111,9 +111,24 @@
SYSINIT(tunable_mbinit, SI_SUB_TUNABLES, SI_ORDER_ANY, tunable_mbinit, NULL);
SYSCTL_DECL(_kern_ipc);
-/* XXX: These should be tuneables. Can't change UMA limits on the fly. */
-SYSCTL_INT(_kern_ipc, OID_AUTO, nmbclusters, CTLFLAG_RW, &nmbclusters, 0,
- "Maximum number of mbuf clusters allowed");
+static int
+nmbcheck(SYSCTL_HANDLER_ARGS)
+{
+ int error, oldnmbclusters;
+
+ oldnmbclusters = nmbclusters;
+ error = sysctl_handle_int(oidp, oidp->oid_arg1, oidp->oid_arg2, req);
+ if (error == 0 && req->newptr) {
+ if (nmbclusters < oldnmbclusters) {
+ nmbclusters = oldnmbclusters;
+ return (EINVAL);
+ }
+ uma_zone_set_max(zone_clust, nmbclusters);
+ }
+ return (error);
+}
+SYSCTL_PROC(_kern_ipc, OID_AUTO, nmbclusters, CTLTYPE_INT|CTLFLAG_RW,
+ &nmbclusters, 0, nmbcheck, "IU", "Maximum number of mbuf clusters allowed");
SYSCTL_INT(_kern_ipc, OID_AUTO, nmbjumbo4, CTLFLAG_RW, &nmbjumbo4, 0,
"Maximum number of mbuf 4k jumbo clusters allowed");
SYSCTL_INT(_kern_ipc, OID_AUTO, nmbjumbo9, CTLFLAG_RW, &nmbjumbo9, 0,
More information about the p4-projects
mailing list