Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-8]: src/sys/kern Pull up following revision(s) (requested by msai...



details:   https://anonhg.NetBSD.org/src/rev/fb10c53860e7
branches:  netbsd-8
changeset: 990068:fb10c53860e7
user:      martin <martin%NetBSD.org@localhost>
date:      Mon Oct 25 15:49:48 2021 +0000

description:
Pull up following revision(s) (requested by msaitoh in ticket #1703):

        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 42fda6e36260 -r fb10c53860e7 share/man/man4/options.4
--- a/share/man/man4/options.4  Sat Oct 23 11:53:10 2021 +0000
+++ b/share/man/man4/options.4  Mon Oct 25 15:49:48 2021 +0000
@@ -1,4 +1,4 @@
-.\"    $NetBSD: options.4,v 1.466.2.2 2019/09/02 16:39:20 martin Exp $
+.\"    $NetBSD: options.4,v 1.466.2.3 2021/10/25 15:49:49 martin Exp $
 .\"
 .\" Copyright (c) 1996
 .\"    Perry E. Metzger.  All rights reserved.
@@ -2184,15 +2184,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 42fda6e36260 -r fb10c53860e7 sys/conf/files
--- a/sys/conf/files    Sat Oct 23 11:53:10 2021 +0000
+++ b/sys/conf/files    Mon Oct 25 15:49:48 2021 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: files,v 1.1173.2.9 2020/03/08 09:42:29 martin Exp $
+#      $NetBSD: files,v 1.1173.2.10 2021/10/25 15:49:48 martin Exp $
 #      @(#)files.newconf       7.5 (Berkeley) 5/10/93
 
 version        20170615
@@ -272,6 +272,7 @@
 #
 defflag                                GATEWAY
 defparam opt_nmbclusters.h     NMBCLUSTERS
+                               NMBCLUSTERS_MAX
 defparam                       SB_MAX
 
 # file system options
diff -r 42fda6e36260 -r fb10c53860e7 sys/kern/uipc_mbuf.c
--- a/sys/kern/uipc_mbuf.c      Sat Oct 23 11:53:10 2021 +0000
+++ b/sys/kern/uipc_mbuf.c      Mon Oct 25 15:49:48 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uipc_mbuf.c,v 1.172.6.5 2018/05/22 17:50:27 martin Exp $       */
+/*     $NetBSD: uipc_mbuf.c,v 1.172.6.6 2021/10/25 15:49:49 martin Exp $       */
 
 /*-
  * Copyright (c) 1999, 2001 The NetBSD Foundation, Inc.
@@ -62,7 +62,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uipc_mbuf.c,v 1.172.6.5 2018/05/22 17:50:27 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uipc_mbuf.c,v 1.172.6.6 2021/10/25 15:49:49 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_mbuftrace.h"
@@ -163,11 +163,7 @@
        max_size = MIN(max_size, NMBCLUSTERS_MAX);
 #endif
 
-#ifdef NMBCLUSTERS
-       return MIN(max_size, NMBCLUSTERS);
-#else
        return max_size;
-#endif
 }
 
 /*
@@ -197,7 +193,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