Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-9]: src/sys/kern Pull up following revision(s) (requested by msai...
details: https://anonhg.NetBSD.org/src/rev/01e8e29f9bda
branches: netbsd-9
changeset: 990066:01e8e29f9bda
user: martin <martin%NetBSD.org@localhost>
date: Mon Oct 25 15:47:50 2021 +0000
description:
Pull up following revision(s) (requested by msaitoh in ticket #1368):
sys/conf/files: revision 1.1288
sys/kern/uipc_mbuf.c: revision 1.244
share/man/man4/options.4: revision 1.520
Fix a bug that NMBCLUSTERS(kern.mbuf.nmbclusters) can't be changed by sysctl.
Update the description of the NMBCLUSTERS. Add NMBCLUSTERS_MAX.
defparam NMBCLUSTERS_MAX.
diffstat:
share/man/man4/options.4 | 15 ++++++++++-----
sys/conf/files | 3 ++-
sys/kern/uipc_mbuf.c | 10 +++-------
3 files changed, 15 insertions(+), 13 deletions(-)
diffs (90 lines):
diff -r 159850fd4873 -r 01e8e29f9bda share/man/man4/options.4
--- a/share/man/man4/options.4 Sun Oct 24 10:19:01 2021 +0000
+++ b/share/man/man4/options.4 Mon Oct 25 15:47:50 2021 +0000
@@ -1,4 +1,4 @@
-.\" $NetBSD: options.4,v 1.506.2.1 2019/09/05 09:00:22 martin Exp $
+.\" $NetBSD: options.4,v 1.506.2.2 2021/10/25 15:47:50 martin Exp $
.\"
.\" Copyright (c) 1996
.\" Perry E. Metzger. All rights reserved.
@@ -2082,15 +2082,20 @@
This is used to compute the size of the kernel VM map
.Em mb_map ,
which maps mbuf clusters.
-Default on most ports is 1024 (2048 with
-.Dq options GATEWAY
-).
+The default value is calculated from the amount of physical memory.
+Architectures without direct mapping also limit it based on the kmem_map size,
+which is used as backing store.
+Some archs limit the value with
+.Sq NMBCLUSTERS_MAX .
See
.Pa /usr/include/machine/param.h
-for exact default information.
+for those archs.
+This value can be accessed via the kern.mbuf.nmbclusters sysctl variable.
Increase this value if you get
.Dq mclpool limit reached
messages.
+.It Cd options NMBCLUSTERS_MAX=value
+The upper limit of NMBCLUSTERS.
.It Cd options NKMEMPAGES=value
.It Cd options NKMEMPAGES_MIN=value
.It Cd options NKMEMPAGES_MAX=value
diff -r 159850fd4873 -r 01e8e29f9bda sys/conf/files
--- a/sys/conf/files Sun Oct 24 10:19:01 2021 +0000
+++ b/sys/conf/files Mon Oct 25 15:47:50 2021 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: files,v 1.1237.2.5 2020/03/08 10:18:04 martin Exp $
+# $NetBSD: files,v 1.1237.2.6 2021/10/25 15:47:50 martin Exp $
# @(#)files.newconf 7.5 (Berkeley) 5/10/93
version 20171118
@@ -285,6 +285,7 @@
#
defflag GATEWAY
defparam opt_nmbclusters.h NMBCLUSTERS
+ NMBCLUSTERS_MAX
defparam SB_MAX
# file system options
diff -r 159850fd4873 -r 01e8e29f9bda sys/kern/uipc_mbuf.c
--- a/sys/kern/uipc_mbuf.c Sun Oct 24 10:19:01 2021 +0000
+++ b/sys/kern/uipc_mbuf.c Mon Oct 25 15:47:50 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: uipc_mbuf.c,v 1.232.4.1 2020/08/11 17:14:21 martin Exp $ */
+/* $NetBSD: uipc_mbuf.c,v 1.232.4.2 2021/10/25 15:47:50 martin Exp $ */
/*
* Copyright (c) 1999, 2001, 2018 The NetBSD Foundation, Inc.
@@ -62,7 +62,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uipc_mbuf.c,v 1.232.4.1 2020/08/11 17:14:21 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uipc_mbuf.c,v 1.232.4.2 2021/10/25 15:47:50 martin Exp $");
#ifdef _KERNEL_OPT
#include "opt_mbuftrace.h"
@@ -165,11 +165,7 @@
max_size = MIN(max_size, NMBCLUSTERS_MAX);
#endif
-#ifdef NMBCLUSTERS
- return MIN(max_size, NMBCLUSTERS);
-#else
return max_size;
-#endif
}
/*
@@ -199,7 +195,7 @@
* Set an arbitrary default limit on the number of mbuf clusters.
*/
#ifdef NMBCLUSTERS
- nmbclusters = nmbclusters_limit();
+ nmbclusters = MIN(NMBCLUSTERS, nmbclusters_limit());
#else
nmbclusters = MAX(1024,
(vsize_t)physmem * PAGE_SIZE / MCLBYTES / 16);
Home |
Main Index |
Thread Index |
Old Index