Source-Changes-HG archive

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

[src/trunk]: src/sys/kern Fix a bug that NMBCLUSTERS(kern.mbuf.nmbclusters) c...



details:   https://anonhg.NetBSD.org/src/rev/617294015685
branches:  trunk
changeset: 988265:617294015685
user:      msaitoh <msaitoh%NetBSD.org@localhost>
date:      Wed Oct 06 05:24:54 2021 +0000

description:
Fix a bug that NMBCLUSTERS(kern.mbuf.nmbclusters) can't be changed by sysctl.

diffstat:

 sys/kern/uipc_mbuf.c |  10 +++-------
 1 files changed, 3 insertions(+), 7 deletions(-)

diffs (39 lines):

diff -r fcf6a7667139 -r 617294015685 sys/kern/uipc_mbuf.c
--- a/sys/kern/uipc_mbuf.c      Tue Oct 05 22:22:46 2021 +0000
+++ b/sys/kern/uipc_mbuf.c      Wed Oct 06 05:24:54 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uipc_mbuf.c,v 1.243 2021/03/04 01:37:42 msaitoh Exp $  */
+/*     $NetBSD: uipc_mbuf.c,v 1.244 2021/10/06 05:24:54 msaitoh 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.243 2021/03/04 01:37:42 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uipc_mbuf.c,v 1.244 2021/10/06 05:24:54 msaitoh 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