summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorDavid Gwynne <dlg@cvs.openbsd.org>2017-02-07 07:00:22 +0000
committerDavid Gwynne <dlg@cvs.openbsd.org>2017-02-07 07:00:22 +0000
commit9aac9f2caee698396395a53e238bca2705c4b528 (patch)
treeeb06ee2e6981b0872ab1075d680deab094ef812a /sys
parent67396f9c1961fb55f2dcaee56adf1b58257f7a04 (diff)
enable per cpu caches on the mbuf pools.
this didnt make sense previously since the mbuf pools had item limits that meant the cpus had to coordinate via a single counter to make sure the limit wasnt exceeded. mbufs are now limited by how much memory can be allocated for pages from the system. individual pool items are no longer counted and therefore do not have to be coordinated. ok bluhm@ as part of a larger diff.
Diffstat (limited to 'sys')
-rw-r--r--sys/kern/uipc_mbuf.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/sys/kern/uipc_mbuf.c b/sys/kern/uipc_mbuf.c
index 8ce362cc78b..2dd51c51c81 100644
--- a/sys/kern/uipc_mbuf.c
+++ b/sys/kern/uipc_mbuf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uipc_mbuf.c,v 1.244 2017/02/07 06:51:58 dlg Exp $ */
+/* $OpenBSD: uipc_mbuf.c,v 1.245 2017/02/07 07:00:21 dlg Exp $ */
/* $NetBSD: uipc_mbuf.c,v 1.15.4.1 1996/06/13 17:11:44 cgd Exp $ */
/*
@@ -198,7 +198,15 @@ mbinit(void)
void
mbcpuinit()
{
+ int i;
+
mbstat = counters_alloc_ncpus(mbstat, MBSTAT_COUNT);
+
+ pool_cache_init(&mbpool);
+ pool_cache_init(&mtagpool);
+
+ for (i = 0; i < nitems(mclsizes); i++)
+ pool_cache_init(&mclpools[i]);
}
void