kern_mbuf.c (156428) | kern_mbuf.c (157927) |
---|---|
1/*- 2 * Copyright (c) 2004, 2005, 3 * Bosko Milekic <bmilekic@FreeBSD.org>. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 12 unchanged lines hidden (view full) --- 21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25 * SUCH DAMAGE. 26 */ 27 28#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2004, 2005, 3 * Bosko Milekic <bmilekic@FreeBSD.org>. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 12 unchanged lines hidden (view full) --- 21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25 * SUCH DAMAGE. 26 */ 27 28#include <sys/cdefs.h> |
29__FBSDID("$FreeBSD: head/sys/kern/kern_mbuf.c 156428 2006-03-08 14:05:38Z andre $"); | 29__FBSDID("$FreeBSD: head/sys/kern/kern_mbuf.c 157927 2006-04-21 09:25:40Z ps $"); |
30 31#include "opt_mac.h" 32#include "opt_param.h" 33 34#include <sys/param.h> 35#include <sys/mac.h> 36#include <sys/malloc.h> 37#include <sys/systm.h> --- 69 unchanged lines hidden (view full) --- 107 /* This has to be done before VM init. */ 108 nmbclusters = 1024 + maxusers * 64; 109 TUNABLE_INT_FETCH("kern.ipc.nmbclusters", &nmbclusters); 110} 111SYSINIT(tunable_mbinit, SI_SUB_TUNABLES, SI_ORDER_ANY, tunable_mbinit, NULL); 112 113SYSCTL_DECL(_kern_ipc); 114/* XXX: These should be tuneables. Can't change UMA limits on the fly. */ | 30 31#include "opt_mac.h" 32#include "opt_param.h" 33 34#include <sys/param.h> 35#include <sys/mac.h> 36#include <sys/malloc.h> 37#include <sys/systm.h> --- 69 unchanged lines hidden (view full) --- 107 /* This has to be done before VM init. */ 108 nmbclusters = 1024 + maxusers * 64; 109 TUNABLE_INT_FETCH("kern.ipc.nmbclusters", &nmbclusters); 110} 111SYSINIT(tunable_mbinit, SI_SUB_TUNABLES, SI_ORDER_ANY, tunable_mbinit, NULL); 112 113SYSCTL_DECL(_kern_ipc); 114/* XXX: These should be tuneables. Can't change UMA limits on the fly. */ |
115SYSCTL_INT(_kern_ipc, OID_AUTO, nmbclusters, CTLFLAG_RW, &nmbclusters, 0, | 115static int 116sysctl_nmbclusters(SYSCTL_HANDLER_ARGS) 117{ 118 int error, newnmbclusters; 119 120 newnmbclusters = nmbclusters; 121 error = sysctl_handle_int(oidp, &newnmbclusters, sizeof(int), req); 122 if (error == 0 && req->newptr) { 123 if (newnmbclusters > nmbclusters) { 124 nmbclusters = newnmbclusters; 125 uma_zone_set_max(zone_clust, nmbclusters); 126 EVENTHANDLER_INVOKE(nmbclusters_change); 127 } else 128 error = EINVAL; 129 } 130 return (error); 131} 132SYSCTL_PROC(_kern_ipc, OID_AUTO, nmbclusters, CTLTYPE_INT|CTLFLAG_RW, 133&nmbclusters, 0, sysctl_nmbclusters, "IU", |
116 "Maximum number of mbuf clusters allowed"); 117SYSCTL_INT(_kern_ipc, OID_AUTO, nmbjumbop, CTLFLAG_RW, &nmbjumbop, 0, 118 "Maximum number of mbuf page size jumbo clusters allowed"); 119SYSCTL_INT(_kern_ipc, OID_AUTO, nmbjumbo9, CTLFLAG_RW, &nmbjumbo9, 0, 120 "Maximum number of mbuf 9k jumbo clusters allowed"); 121SYSCTL_INT(_kern_ipc, OID_AUTO, nmbjumbo16, CTLFLAG_RW, &nmbjumbo16, 0, 122 "Maximum number of mbuf 16k jumbo clusters allowed"); 123SYSCTL_STRUCT(_kern_ipc, OID_AUTO, mbstat, CTLFLAG_RD, &mbstat, mbstat, --- 436 unchanged lines hidden --- | 134 "Maximum number of mbuf clusters allowed"); 135SYSCTL_INT(_kern_ipc, OID_AUTO, nmbjumbop, CTLFLAG_RW, &nmbjumbop, 0, 136 "Maximum number of mbuf page size jumbo clusters allowed"); 137SYSCTL_INT(_kern_ipc, OID_AUTO, nmbjumbo9, CTLFLAG_RW, &nmbjumbo9, 0, 138 "Maximum number of mbuf 9k jumbo clusters allowed"); 139SYSCTL_INT(_kern_ipc, OID_AUTO, nmbjumbo16, CTLFLAG_RW, &nmbjumbo16, 0, 140 "Maximum number of mbuf 16k jumbo clusters allowed"); 141SYSCTL_STRUCT(_kern_ipc, OID_AUTO, mbstat, CTLFLAG_RD, &mbstat, mbstat, --- 436 unchanged lines hidden --- |