tech-kern archive

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

Re: Dropping mb_map



Hi all,
attached is a patch to rework the mbuf cluster limit.

First of all, it drops the static platform limits and detangles the
cluster limit from GATEWAY. 

Second, it provides an dynamic upper limit of 1/4 the physical memory or
half of the kmem map if not using direct mapping, whatever is smaller. 
If NMBCLUSTERS is set, it is placing another limit. i386 and ARM get an
additional limit of 64MB in clusters, due to the small KVA size. All
other platforms seems to be either 64bit or using direct mappings.

Third, it uses 1/16 of the physical memory in clusters or 1024 as
default value. If NMBCLUSTERS is set, it is used directly. The default
value should be as large as the old default for most sane systems.

Fourth, kern.mbuf.nmbclusters can be raised up to the limit in step two
at runtime.

There is one stray change, the key_registered_sb_max limit is hard-coded
based on NMBCLUSTERS=2048. As the comment says, it is arbitrary, so I
haven't bothered with doing something smarter.

Comments?

Joerg
Index: sys/arch/acorn26/acorn26/machdep.c
===================================================================
RCS file: /home/joerg/repo/netbsd/src/sys/arch/acorn26/acorn26/machdep.c,v
retrieving revision 1.32
diff -u -p -r1.32 machdep.c
--- sys/arch/acorn26/acorn26/machdep.c  21 Nov 2009 20:32:17 -0000      1.32
+++ sys/arch/acorn26/acorn26/machdep.c  4 Feb 2010 19:21:45 -0000
@@ -57,7 +57,6 @@ __KERNEL_RCSID(0, "$NetBSD: machdep.c,v 
 char cpu_model[] = "Archimedes";
 
 struct vm_map *phys_map = NULL;
-struct vm_map *mb_map = NULL; /* and ever more shall be so */
 
 int waittime = -1;
 
Index: sys/arch/acorn26/include/param.h
===================================================================
RCS file: /home/joerg/repo/netbsd/src/sys/arch/acorn26/include/param.h,v
retrieving revision 1.3
diff -u -p -r1.3 param.h
--- sys/arch/acorn26/include/param.h    14 Jan 2009 23:14:48 -0000      1.3
+++ sys/arch/acorn26/include/param.h    4 Feb 2010 20:01:08 -0000
@@ -58,18 +58,6 @@
 #define MSGBUFSIZE     NBPG            /* default message buffer size */
 #endif
 
-#ifndef NMBCLUSTERS
-#if defined(_KERNEL_OPT)
-#include "opt_gateway.h"
-#endif
-
-#ifdef GATEWAY
-#define        NMBCLUSTERS     512             /* map size, max cluster 
allocation */
-#else
-#define        NMBCLUSTERS     256             /* map size, max cluster 
allocation */
-#endif
-#endif
-
 /*
  * Defaults for lower- and upper-bounds for the kmem_map page count.
  * Can be overridden by kernel config options.
Index: sys/arch/algor/algor/machdep.c
===================================================================
RCS file: /home/joerg/repo/netbsd/src/sys/arch/algor/algor/machdep.c,v
retrieving revision 1.44
diff -u -p -r1.44 machdep.c
--- sys/arch/algor/algor/machdep.c      14 Dec 2009 00:45:59 -0000      1.44
+++ sys/arch/algor/algor/machdep.c      4 Feb 2010 19:21:49 -0000
@@ -187,7 +187,6 @@ struct p6032_config p6032_configuration;
 struct cpu_info cpu_info_store;
 
 /* Maps for VM objects. */
-struct vm_map *mb_map = NULL;
 struct vm_map *phys_map = NULL;
 
 int    physmem;                /* # pages of physical memory */
Index: sys/arch/alpha/alpha/machdep.c
===================================================================
RCS file: /home/joerg/repo/netbsd/src/sys/arch/alpha/alpha/machdep.c,v
retrieving revision 1.325
diff -u -p -r1.325 machdep.c
--- sys/arch/alpha/alpha/machdep.c      10 Dec 2009 14:13:48 -0000      1.325
+++ sys/arch/alpha/alpha/machdep.c      4 Feb 2010 19:21:53 -0000
@@ -137,7 +137,6 @@ __KERNEL_RCSID(0, "$NetBSD: machdep.c,v 
 
 #include "ksyms.h"
 
-struct vm_map *mb_map = NULL;
 struct vm_map *phys_map = NULL;
 
 void *msgbufaddr;
Index: sys/arch/alpha/include/param.h
===================================================================
RCS file: /home/joerg/repo/netbsd/src/sys/arch/alpha/include/param.h,v
retrieving revision 1.36
diff -u -p -r1.36 param.h
--- sys/arch/alpha/include/param.h      28 Aug 2006 13:43:35 -0000      1.36
+++ sys/arch/alpha/include/param.h      4 Feb 2010 20:01:04 -0000
@@ -142,18 +142,6 @@
 
 #define        MCLBYTES        (1 << MCLSHIFT) /* size of a m_buf cluster */
 
-#ifndef NMBCLUSTERS
-#if defined(_KERNEL_OPT)
-#include "opt_gateway.h"
-#endif
-
-#ifdef GATEWAY
-#define        NMBCLUSTERS     4096            /* map size, max cluster 
allocation */
-#else
-#define        NMBCLUSTERS     2048            /* map size, max cluster 
allocation */
-#endif
-#endif
-
 /*
  * Minimum and maximum sizes of the kernel malloc arena in PAGE_SIZE-sized
  * logical pages.
Index: sys/arch/amd64/amd64/machdep.c
===================================================================
RCS file: /home/joerg/repo/netbsd/src/sys/arch/amd64/amd64/machdep.c,v
retrieving revision 1.141
diff -u -p -r1.141 machdep.c
--- sys/arch/amd64/amd64/machdep.c      31 Dec 2009 01:11:28 -0000      1.141
+++ sys/arch/amd64/amd64/machdep.c      4 Feb 2010 19:22:12 -0000
@@ -256,7 +256,6 @@ static struct vm_map_kernel module_map_s
 extern struct vm_map *module_map;
 vaddr_t kern_end;
 
-struct vm_map *mb_map = NULL;
 struct vm_map *phys_map = NULL;
 
 extern paddr_t avail_start, avail_end;
@@ -341,12 +340,6 @@ cpu_startup(void)
        phys_map = uvm_km_suballoc(kernel_map, &minaddr, &maxaddr,
                                   VM_PHYS_SIZE, 0, false, NULL);
 
-       /*
-        * Finally, allocate mbuf cluster submap.
-        */
-       mb_map = uvm_km_suballoc(kernel_map, &minaddr, &maxaddr,
-           nmbclusters * mclbytes, VM_MAP_INTRSAFE, false, NULL);
-
        uvm_map_setup_kernel(&module_map_store, module_start, module_end, 0);
        module_map_store.vmk_map.pmap = pmap_kernel();
        module_map = &module_map_store.vmk_map;
Index: sys/arch/amd64/include/param.h
===================================================================
RCS file: /home/joerg/repo/netbsd/src/sys/arch/amd64/include/param.h,v
retrieving revision 1.12
diff -u -p -r1.12 param.h
--- sys/arch/amd64/include/param.h      11 Nov 2009 23:59:36 -0000      1.12
+++ sys/arch/amd64/include/param.h      4 Feb 2010 20:11:15 -0000
@@ -86,18 +86,6 @@
 
 #define        MCLBYTES        (1 << MCLSHIFT) /* size of a m_buf cluster */
 
-#ifndef NMBCLUSTERS
-#if defined(_KERNEL_OPT)
-#include "opt_gateway.h"
-#endif
-
-#ifdef GATEWAY
-#define        NMBCLUSTERS     4096            /* map size, max cluster 
allocation */
-#else
-#define        NMBCLUSTERS     2048            /* map size, max cluster 
allocation */
-#endif
-#endif
-
 #ifndef NFS_RSIZE
 #define NFS_RSIZE       32768
 #endif
Index: sys/arch/amiga/amiga/machdep.c
===================================================================
RCS file: /home/joerg/repo/netbsd/src/sys/arch/amiga/amiga/machdep.c,v
retrieving revision 1.224
diff -u -p -r1.224 machdep.c
--- sys/arch/amiga/amiga/machdep.c      10 Dec 2009 14:13:49 -0000      1.224
+++ sys/arch/amiga/amiga/machdep.c      4 Feb 2010 19:22:24 -0000
@@ -163,7 +163,6 @@ void fdintr(int);
 
 volatile unsigned int interrupt_depth = 0;
 
-struct vm_map *mb_map = NULL;
 struct vm_map *phys_map = NULL;
 
 void * msgbufaddr;
@@ -291,13 +290,6 @@ cpu_startup(void)
        phys_map = uvm_km_suballoc(kernel_map, &minaddr, &maxaddr,
                                   VM_PHYS_SIZE, 0, false, NULL);
 
-       /*
-        * Finally, allocate mbuf cluster submap.
-        */
-       mb_map = uvm_km_suballoc(kernel_map, &minaddr, &maxaddr,
-                                nmbclusters * mclbytes, VM_MAP_INTRSAFE,
-                                false, NULL);
-
 #ifdef DEBUG
        pmapdebug = opmapdebug;
 #endif
Index: sys/arch/arc/arc/machdep.c
===================================================================
RCS file: /home/joerg/repo/netbsd/src/sys/arch/arc/arc/machdep.c,v
retrieving revision 1.119
diff -u -p -r1.119 machdep.c
--- sys/arch/arc/arc/machdep.c  16 Dec 2009 23:19:06 -0000      1.119
+++ sys/arch/arc/arc/machdep.c  4 Feb 2010 19:22:28 -0000
@@ -167,7 +167,6 @@ __KERNEL_RCSID(0, "$NetBSD: machdep.c,v 
 struct cpu_info cpu_info_store;
 
 /* maps for VM objects */
-struct vm_map *mb_map = NULL;
 struct vm_map *phys_map = NULL;
 
 int    maxmem;                 /* max memory per process */
Index: sys/arch/arc/include/param.h
===================================================================
RCS file: /home/joerg/repo/netbsd/src/sys/arch/arc/include/param.h,v
retrieving revision 1.25
diff -u -p -r1.25 param.h
--- sys/arch/arc/include/param.h        13 Aug 2009 05:15:08 -0000      1.25
+++ sys/arch/arc/include/param.h        4 Feb 2010 20:10:47 -0000
@@ -132,18 +132,6 @@
 
 #define        MCLBYTES        (1 << MCLSHIFT) /* size of a m_buf cluster */
 
-#ifndef NMBCLUSTERS
-#if defined(_KERNEL_OPT)
-#include "opt_gateway.h"
-#endif
-
-#ifdef GATEWAY
-#define        NMBCLUSTERS     2048            /* map size, max cluster 
allocation */
-#else
-#define        NMBCLUSTERS     1024            /* map size, max cluster 
allocation */
-#endif
-#endif
-
 /* bytes to disk blocks */
 #define        btodb(x)        ((x) >> DEV_BSHIFT)
 #define dbtob(x)       ((x) << DEV_BSHIFT)
Index: sys/arch/arm/arm32/arm32_machdep.c
===================================================================
RCS file: /home/joerg/repo/netbsd/src/sys/arch/arm/arm32/arm32_machdep.c,v
retrieving revision 1.72
diff -u -p -r1.72 arm32_machdep.c
--- sys/arch/arm/arm32/arm32_machdep.c  18 Jan 2010 23:04:30 -0000      1.72
+++ sys/arch/arm/arm32/arm32_machdep.c  4 Feb 2010 19:22:40 -0000
@@ -71,7 +71,6 @@ __KERNEL_RCSID(0, "$NetBSD: arm32_machde
 
 #include "md.h"
 
-struct vm_map *mb_map = NULL;
 struct vm_map *phys_map = NULL;
 
 #if NMD > 0 && defined(MEMORY_DISK_HOOKS) && !defined(MEMORY_DISK_ROOT_SIZE)
@@ -244,13 +243,6 @@ cpu_startup(void)
        phys_map = uvm_km_suballoc(kernel_map, &minaddr, &maxaddr,
                                   VM_PHYS_SIZE, 0, false, NULL);
 
-       /*
-        * Finally, allocate mbuf cluster submap.
-        */
-       mb_map = uvm_km_suballoc(kernel_map, &minaddr, &maxaddr,
-                                nmbclusters * mclbytes, VM_MAP_INTRSAFE,
-                                false, NULL);
-
        format_bytes(pbuf, sizeof(pbuf), ptoa(uvmexp.free));
        printf("avail memory = %s\n", pbuf);
 
Index: sys/arch/arm/include/arm32/param.h
===================================================================
RCS file: /home/joerg/repo/netbsd/src/sys/arch/arm/include/arm32/param.h,v
retrieving revision 1.14
diff -u -p -r1.14 param.h
--- sys/arch/arm/include/arm32/param.h  14 Mar 2009 14:45:55 -0000      1.14
+++ sys/arch/arm/include/arm32/param.h  4 Feb 2010 20:10:27 -0000
@@ -60,18 +60,6 @@
 #define MSGBUFSIZE     NBPG            /* default message buffer size */
 #endif
 
-#ifndef NMBCLUSTERS
-#if defined(_KERNEL_OPT)
-#include "opt_gateway.h"
-#endif
-
-#ifdef GATEWAY
-#define        NMBCLUSTERS     2048            /* map size, max cluster 
allocation */
-#else
-#define        NMBCLUSTERS     1024            /* map size, max cluster 
allocation */
-#endif
-#endif
-
 /*
  * Minimum and maximum sizes of the kernel malloc arena in PAGE_SIZE-sized
  * logical pages.
Index: sys/arch/atari/atari/machdep.c
===================================================================
RCS file: /home/joerg/repo/netbsd/src/sys/arch/atari/atari/machdep.c,v
retrieving revision 1.164
diff -u -p -r1.164 machdep.c
--- sys/arch/atari/atari/machdep.c      10 Dec 2009 14:13:49 -0000      1.164
+++ sys/arch/atari/atari/machdep.c      4 Feb 2010 19:22:55 -0000
@@ -140,7 +140,6 @@ void        straytrap(int, u_short);
 void   nmihandler(void);
 #endif
 
-struct vm_map *mb_map = NULL;
 struct vm_map *phys_map = NULL;
 
 void * msgbufaddr;
@@ -258,12 +257,6 @@ cpu_startup(void)
        phys_map = uvm_km_suballoc(kernel_map, &minaddr, &maxaddr,
            VM_PHYS_SIZE, 0, false, NULL);
 
-       /*
-        * Finally, allocate mbuf cluster submap.
-        */
-       mb_map = uvm_km_suballoc(kernel_map, &minaddr, &maxaddr,
-           nmbclusters * mclbytes, VM_MAP_INTRSAFE, false, NULL);
-
 #ifdef DEBUG
        pmapdebug = opmapdebug;
 #endif
Index: sys/arch/cesfic/cesfic/machdep.c
===================================================================
RCS file: /home/joerg/repo/netbsd/src/sys/arch/cesfic/cesfic/machdep.c,v
retrieving revision 1.53
diff -u -p -r1.53 machdep.c
--- sys/arch/cesfic/cesfic/machdep.c    10 Dec 2009 14:13:49 -0000      1.53
+++ sys/arch/cesfic/cesfic/machdep.c    4 Feb 2010 19:23:05 -0000
@@ -147,7 +147,6 @@ char machine[] = MACHINE;           /* CPU "archi
 /* Our exported CPU info; we can have only one. */  
 struct cpu_info cpu_info_store;
 
-struct vm_map *mb_map = NULL;
 struct vm_map *phys_map = NULL;
 
 /*
@@ -308,13 +307,6 @@ cpu_startup(void)
        phys_map = uvm_km_suballoc(kernel_map, &minaddr, &maxaddr,
                                   VM_PHYS_SIZE, 0, false, NULL);
 
-       /*
-        * Finally, allocate mbuf cluster submap.
-        */
-       mb_map = uvm_km_suballoc(kernel_map, &minaddr, &maxaddr,
-                                nmbclusters * mclbytes, VM_MAP_INTRSAFE,
-                                false, NULL);
-
 #ifdef DEBUG
        pmapdebug = opmapdebug;
 #endif
Index: sys/arch/cesfic/conf/GENERIC
===================================================================
RCS file: /home/joerg/repo/netbsd/src/sys/arch/cesfic/conf/GENERIC,v
retrieving revision 1.52
diff -u -p -r1.52 GENERIC
--- sys/arch/cesfic/conf/GENERIC        24 Jan 2009 05:06:05 -0000      1.52
+++ sys/arch/cesfic/conf/GENERIC        4 Feb 2010 19:23:13 -0000
@@ -83,7 +83,7 @@ options       FIFO            # POSIX fifo support (in 
 
 # Networking options
 options        INET            # Internet protocols
-#options       GATEWAY         # IP forwarding + larger mb_map
+#options       GATEWAY         # IP forwarding
 #options       MROUTING        # Multicast routing
 #options       PIM             # Protocol Independent Multicast
 #options       PFIL_HOOKS      # packet filter hooks
Index: sys/arch/cobalt/cobalt/machdep.c
===================================================================
RCS file: /home/joerg/repo/netbsd/src/sys/arch/cobalt/cobalt/machdep.c,v
retrieving revision 1.108
diff -u -p -r1.108 machdep.c
--- sys/arch/cobalt/cobalt/machdep.c    18 Dec 2009 23:22:28 -0000      1.108
+++ sys/arch/cobalt/cobalt/machdep.c    4 Feb 2010 19:23:17 -0000
@@ -97,7 +97,6 @@ __KERNEL_RCSID(0, "$NetBSD: machdep.c,v 
 struct cpu_info cpu_info_store;
 
 /* Maps for VM objects. */
-struct vm_map *mb_map = NULL;
 struct vm_map *phys_map = NULL;
 
 int    physmem;                /* Total physical memory */
Index: sys/arch/evbarm/conf/CP3100
===================================================================
RCS file: /home/joerg/repo/netbsd/src/sys/arch/evbarm/conf/CP3100,v
retrieving revision 1.15
diff -u -p -r1.15 CP3100
--- sys/arch/evbarm/conf/CP3100 5 Dec 2009 20:11:11 -0000       1.15
+++ sys/arch/evbarm/conf/CP3100 4 Feb 2010 20:12:00 -0000
@@ -15,7 +15,6 @@ maxusers      32
 
 options        RTC_OFFSET=0    # hardware clock is this many mins. west of GMT
 options        NTP             # NTP phase/frequency locked loop
-#options       NMBCLUSTERS=1024
 
 # CPU options
 
Index: sys/arch/evbmips/adm5120/machdep.c
===================================================================
RCS file: /home/joerg/repo/netbsd/src/sys/arch/evbmips/adm5120/machdep.c,v
retrieving revision 1.15
diff -u -p -r1.15 machdep.c
--- sys/arch/evbmips/adm5120/machdep.c  22 Jan 2010 08:56:05 -0000      1.15
+++ sys/arch/evbmips/adm5120/machdep.c  4 Feb 2010 19:23:40 -0000
@@ -164,7 +164,6 @@ __KERNEL_RCSID(0, "$NetBSD: machdep.c,v 
 struct cpu_info cpu_info_store;
 
 /* Maps for VM objects. */
-struct vm_map *mb_map = NULL;
 struct vm_map *phys_map = NULL;
 
 int maxmem;                    /* max memory per process */
Index: sys/arch/evbmips/alchemy/machdep.c
===================================================================
RCS file: /home/joerg/repo/netbsd/src/sys/arch/evbmips/alchemy/machdep.c,v
retrieving revision 1.46
diff -u -p -r1.46 machdep.c
--- sys/arch/evbmips/alchemy/machdep.c  16 Dec 2009 08:26:14 -0000      1.46
+++ sys/arch/evbmips/alchemy/machdep.c  4 Feb 2010 19:23:43 -0000
@@ -166,7 +166,6 @@ int aucomcnrate = 0;
 struct cpu_info cpu_info_store;
 
 /* Maps for VM objects. */
-struct vm_map *mb_map = NULL;
 struct vm_map *phys_map = NULL;
 
 int maxmem;                    /* max memory per process */
Index: sys/arch/evbmips/atheros/machdep.c
===================================================================
RCS file: /home/joerg/repo/netbsd/src/sys/arch/evbmips/atheros/machdep.c,v
retrieving revision 1.21
diff -u -p -r1.21 machdep.c
--- sys/arch/evbmips/atheros/machdep.c  14 Dec 2009 00:46:01 -0000      1.21
+++ sys/arch/evbmips/atheros/machdep.c  4 Feb 2010 19:23:47 -0000
@@ -187,7 +187,6 @@ __KERNEL_RCSID(0, "$NetBSD: machdep.c,v 
 struct cpu_info cpu_info_store;
 
 /* Maps for VM objects. */
-struct vm_map *mb_map = NULL;
 struct vm_map *phys_map = NULL;
 
 int maxmem;                    /* max memory per process */
Index: sys/arch/evbmips/gdium/machdep.c
===================================================================
RCS file: /home/joerg/repo/netbsd/src/sys/arch/evbmips/gdium/machdep.c,v
retrieving revision 1.10
diff -u -p -r1.10 machdep.c
--- sys/arch/evbmips/gdium/machdep.c    27 Nov 2009 03:23:08 -0000      1.10
+++ sys/arch/evbmips/gdium/machdep.c    4 Feb 2010 19:23:50 -0000
@@ -168,7 +168,6 @@ extern char cpu_model[];
 struct cpu_info cpu_info_store;
 
 /* Maps for VM objects. */
-struct vm_map *mb_map = NULL;
 struct vm_map *phys_map = NULL;
 
 int    netboot;                /* Are we netbooting? */
Index: sys/arch/evbmips/malta/machdep.c
===================================================================
RCS file: /home/joerg/repo/netbsd/src/sys/arch/evbmips/malta/machdep.c,v
retrieving revision 1.37
diff -u -p -r1.37 machdep.c
--- sys/arch/evbmips/malta/machdep.c    14 Dec 2009 00:46:02 -0000      1.37
+++ sys/arch/evbmips/malta/machdep.c    4 Feb 2010 19:23:52 -0000
@@ -169,7 +169,6 @@ extern char cpu_model[];
 struct cpu_info cpu_info_store;
 
 /* Maps for VM objects. */
-struct vm_map *mb_map = NULL;
 struct vm_map *phys_map = NULL;
 
 int    physmem;                /* Total physical memory */
Index: sys/arch/evbmips/rmixl/machdep.c
===================================================================
RCS file: /home/joerg/repo/netbsd/src/sys/arch/evbmips/rmixl/machdep.c,v
retrieving revision 1.3
diff -u -p -r1.3 machdep.c
--- sys/arch/evbmips/rmixl/machdep.c    20 Dec 2009 04:11:37 -0000      1.3
+++ sys/arch/evbmips/rmixl/machdep.c    4 Feb 2010 19:23:55 -0000
@@ -230,7 +230,6 @@ extern char cpu_model[];
 struct cpu_info cpu_info_store;
 
 /* Maps for VM objects. */
-struct vm_map *mb_map = NULL;
 struct vm_map *phys_map = NULL;
 
 int    physmem;                /* Total physical memory */
Index: sys/arch/evbppc/conf/EV64260
===================================================================
RCS file: /home/joerg/repo/netbsd/src/sys/arch/evbppc/conf/EV64260,v
retrieving revision 1.41
diff -u -p -r1.41 EV64260
--- sys/arch/evbppc/conf/EV64260        24 Dec 2009 09:26:43 -0000      1.41
+++ sys/arch/evbppc/conf/EV64260        4 Feb 2010 20:12:20 -0000
@@ -127,7 +127,6 @@ options     INET            # IP + ICMP + TCP + UDP
 #options       IPFILTER_LOG    # ipmon(8) log support
 #options       IPFILTER_LOOKUP # ippool(8) support
 #options       TCP_DEBUG       # Record last TCP_NDEBUG packets with SO_DEBUG
-#options       NMBCLUSTERS=1024
 
 # These options enable verbose messages for several subsystems.
 # Warning, these may compile large string tables into the kernel!
Index: sys/arch/evbppc/conf/OPENBLOCKS200
===================================================================
RCS file: /home/joerg/repo/netbsd/src/sys/arch/evbppc/conf/OPENBLOCKS200,v
retrieving revision 1.25
diff -u -p -r1.25 OPENBLOCKS200
--- sys/arch/evbppc/conf/OPENBLOCKS200  24 Dec 2009 09:29:36 -0000      1.25
+++ sys/arch/evbppc/conf/OPENBLOCKS200  4 Feb 2010 20:12:17 -0000
@@ -111,7 +111,6 @@ options     PFIL_HOOKS      # pfil(9) packet fil
 options        IPFILTER_LOG    # ipmon(8) log support
 options        IPFILTER_LOOKUP # ippool(8) support
 #options       TCP_DEBUG       # Record last TCP_NDEBUG packets with SO_DEBUG
-options        NMBCLUSTERS=1024
 
 # These options enable verbose messages for several subsystems.
 # Warning, these may compile large string tables into the kernel!
Index: sys/arch/evbppc/conf/PMPPC
===================================================================
RCS file: /home/joerg/repo/netbsd/src/sys/arch/evbppc/conf/PMPPC,v
retrieving revision 1.11
diff -u -p -r1.11 PMPPC
--- sys/arch/evbppc/conf/PMPPC  24 Dec 2009 09:26:43 -0000      1.11
+++ sys/arch/evbppc/conf/PMPPC  4 Feb 2010 20:12:15 -0000
@@ -107,7 +107,6 @@ options     PIM             # Protocol Independent Mul
 #options       IPFILTER_LOG    # ipmon(8) log support
 #options       IPFILTER_LOOKUP # ippool(8) support
 #options       TCP_DEBUG       # Record last TCP_NDEBUG packets with SO_DEBUG
-#options       NMBCLUSTERS=1024
 
 # These options enable verbose messages for several subsystems.
 # Warning, these may compile large string tables into the kernel!
Index: sys/arch/evbppc/conf/VIRTEX_DFC
===================================================================
RCS file: /home/joerg/repo/netbsd/src/sys/arch/evbppc/conf/VIRTEX_DFC,v
retrieving revision 1.8
diff -u -p -r1.8 VIRTEX_DFC
--- sys/arch/evbppc/conf/VIRTEX_DFC     24 Dec 2009 09:26:43 -0000      1.8
+++ sys/arch/evbppc/conf/VIRTEX_DFC     4 Feb 2010 20:12:11 -0000
@@ -126,7 +126,6 @@ options     PPP_FILTER      # Active filter supp
 options        PFIL_HOOKS      # pfil(9) packet filter hooks
 options        IPFILTER_LOG    # ipmon(8) log support
 #options       TCP_DEBUG       # Record last TCP_NDEBUG packets with SO_DEBUG
-options        NMBCLUSTERS=4096
 
 # These options enable verbose messages for several subsystems.
 # Warning, these may compile large string tables into the kernel!
Index: sys/arch/evbppc/conf/VIRTEX_GSRD1
===================================================================
RCS file: /home/joerg/repo/netbsd/src/sys/arch/evbppc/conf/VIRTEX_GSRD1,v
retrieving revision 1.8
diff -u -p -r1.8 VIRTEX_GSRD1
--- sys/arch/evbppc/conf/VIRTEX_GSRD1   24 Dec 2009 09:26:43 -0000      1.8
+++ sys/arch/evbppc/conf/VIRTEX_GSRD1   4 Feb 2010 20:12:09 -0000
@@ -120,7 +120,6 @@ options     PPP_FILTER      # Active filter supp
 options        PFIL_HOOKS      # pfil(9) packet filter hooks
 options        IPFILTER_LOG    # ipmon(8) log support
 #options       TCP_DEBUG       # Record last TCP_NDEBUG packets with SO_DEBUG
-options        NMBCLUSTERS=4096
 
 # These options enable verbose messages for several subsystems.
 # Warning, these may compile large string tables into the kernel!
Index: sys/arch/evbppc/conf/VIRTEX_GSRD2
===================================================================
RCS file: /home/joerg/repo/netbsd/src/sys/arch/evbppc/conf/VIRTEX_GSRD2,v
retrieving revision 1.9
diff -u -p -r1.9 VIRTEX_GSRD2
--- sys/arch/evbppc/conf/VIRTEX_GSRD2   24 Dec 2009 09:26:43 -0000      1.9
+++ sys/arch/evbppc/conf/VIRTEX_GSRD2   4 Feb 2010 20:12:04 -0000
@@ -128,7 +128,6 @@ options     PPP_FILTER      # Active filter supp
 options        PFIL_HOOKS      # pfil(9) packet filter hooks
 options        IPFILTER_LOG    # ipmon(8) log support
 #options       TCP_DEBUG       # Record last TCP_NDEBUG packets with SO_DEBUG
-options        NMBCLUSTERS=4096
 
 # These options enable verbose messages for several subsystems.
 # Warning, these may compile large string tables into the kernel!
Index: sys/arch/evbppc/conf/WALNUT
===================================================================
RCS file: /home/joerg/repo/netbsd/src/sys/arch/evbppc/conf/WALNUT,v
retrieving revision 1.44
diff -u -p -r1.44 WALNUT
--- sys/arch/evbppc/conf/WALNUT 24 Dec 2009 09:29:36 -0000      1.44
+++ sys/arch/evbppc/conf/WALNUT 4 Feb 2010 20:12:07 -0000
@@ -111,7 +111,6 @@ options     PFIL_HOOKS      # pfil(9) packet fil
 options        IPFILTER_LOG    # ipmon(8) log support
 options        IPFILTER_LOOKUP # ippool(8) support
 #options       TCP_DEBUG       # Record last TCP_NDEBUG packets with SO_DEBUG
-options        NMBCLUSTERS=1024
 
 # These options enable verbose messages for several subsystems.
 # Warning, these may compile large string tables into the kernel!
Index: sys/arch/evbppc/explora/machdep.c
===================================================================
RCS file: /home/joerg/repo/netbsd/src/sys/arch/evbppc/explora/machdep.c,v
retrieving revision 1.29
diff -u -p -r1.29 machdep.c
--- sys/arch/evbppc/explora/machdep.c   27 Nov 2009 03:23:08 -0000      1.29
+++ sys/arch/evbppc/explora/machdep.c   4 Feb 2010 19:23:59 -0000
@@ -76,7 +76,6 @@ static const unsigned int cpuspeed = 660
 
 prop_dictionary_t board_properties;
 struct vm_map *phys_map = NULL;
-struct vm_map *mb_map = NULL;
 char msgbuf[MSGBUFSIZE];
 paddr_t msgbuf_paddr;
 
Index: sys/arch/evbppc/obs405/obs405_machdep.c
===================================================================
RCS file: /home/joerg/repo/netbsd/src/sys/arch/evbppc/obs405/obs405_machdep.c,v
retrieving revision 1.4
diff -u -p -r1.4 obs405_machdep.c
--- sys/arch/evbppc/obs405/obs405_machdep.c     2 Jul 2008 17:28:55 -0000       
1.4
+++ sys/arch/evbppc/obs405/obs405_machdep.c     4 Feb 2010 19:24:06 -0000
@@ -43,12 +43,10 @@ __KERNEL_RCSID(0, "$NetBSD: obs405_machd
 
 /*
  * Machine-dependent global variables
- *   mb_map:           sys/uvm/uvm_extern.h
  *   phys_map:         sys/uvm/uvm_extern.h
  *   machine:          sys/sys/systm.h
  *   machine_arch:     sys/sys/systm.h
  */
-struct vm_map *mb_map = NULL;
 struct vm_map *phys_map = NULL;
 char machine[] = MACHINE;              /* from <machine/param.h> */
 char machine_arch[] = MACHINE_ARCH;    /* from <machine/param.h> */
Index: sys/arch/evbppc/virtex/machdep.c
===================================================================
RCS file: /home/joerg/repo/netbsd/src/sys/arch/evbppc/virtex/machdep.c,v
retrieving revision 1.12
diff -u -p -r1.12 machdep.c
--- sys/arch/evbppc/virtex/machdep.c    27 Nov 2009 03:23:08 -0000      1.12
+++ sys/arch/evbppc/virtex/machdep.c    4 Feb 2010 19:24:11 -0000
@@ -89,7 +89,6 @@ __KERNEL_RCSID(0, "$NetBSD: machdep.c,v 
 /*
  * Global variables used here and there
  */
-struct vm_map *mb_map = NULL;
 struct vm_map *phys_map = NULL;
 
 /*
Index: sys/arch/evbppc/walnut/machdep.c
===================================================================
RCS file: /home/joerg/repo/netbsd/src/sys/arch/evbppc/walnut/machdep.c,v
retrieving revision 1.43
diff -u -p -r1.43 machdep.c
--- sys/arch/evbppc/walnut/machdep.c    27 Nov 2009 03:23:08 -0000      1.43
+++ sys/arch/evbppc/walnut/machdep.c    4 Feb 2010 19:24:14 -0000
@@ -120,7 +120,6 @@ __KERNEL_RCSID(0, "$NetBSD: machdep.c,v 
 /*
  * Global variables used here and there
  */
-struct vm_map *mb_map = NULL;
 struct vm_map *phys_map = NULL;
 
 /*
Index: sys/arch/ews4800mips/ews4800mips/machdep.c
===================================================================
RCS file: 
/home/joerg/repo/netbsd/src/sys/arch/ews4800mips/ews4800mips/machdep.c,v
retrieving revision 1.21
diff -u -p -r1.21 machdep.c
--- sys/arch/ews4800mips/ews4800mips/machdep.c  14 Dec 2009 00:46:03 -0000      
1.21
+++ sys/arch/ews4800mips/ews4800mips/machdep.c  4 Feb 2010 19:24:16 -0000
@@ -73,7 +73,6 @@ vsize_t kseg2iobufsize;               /* to reserve P
 struct cpu_info cpu_info_store;
 
 /* maps for VM objects */
-struct vm_map *mb_map;
 struct vm_map *phys_map;
 
 /* referenced by mips_machdep.c:cpu_dump() */
Index: sys/arch/hp300/conf/GENERIC
===================================================================
RCS file: /home/joerg/repo/netbsd/src/sys/arch/hp300/conf/GENERIC,v
retrieving revision 1.151
diff -u -p -r1.151 GENERIC
--- sys/arch/hp300/conf/GENERIC 5 Dec 2009 20:11:14 -0000       1.151
+++ sys/arch/hp300/conf/GENERIC 4 Feb 2010 19:24:23 -0000
@@ -133,7 +133,7 @@ options     INET6           # IPV6
 #options       IPSEC_ESP       # IP security (encryption part; define w/IPSEC)
 #options       IPSEC_NAT_T     # IPsec NAT traversal (NAT-T)
 #options       IPSEC_DEBUG     # debug for IP security
-options        GATEWAY         # IP forwarding + larger mb_map
+options        GATEWAY         # IP forwarding
 options        MROUTING        # Multicast routing
 options        PIM             # Protocol Independent Multicast
 #options       ISO,TPIP        # OSI
Index: sys/arch/hp300/conf/INSTALL
===================================================================
RCS file: /home/joerg/repo/netbsd/src/sys/arch/hp300/conf/INSTALL,v
retrieving revision 1.39
diff -u -p -r1.39 INSTALL
--- sys/arch/hp300/conf/INSTALL 12 Jan 2009 17:24:21 -0000      1.39
+++ sys/arch/hp300/conf/INSTALL 4 Feb 2010 20:12:25 -0000
@@ -14,7 +14,6 @@ makeoptions   COPTS="-Os"
 options        NVNODE=50
 options        NBUF=16
 options        BUFPAGES=16
-options        NMBCLUSTERS=64
 options        NFS_V2_ONLY
 options        NFS_DEFAULT_NIOTHREADS=1
 options        USERCONF                # userconf(4) support
@@ -95,7 +94,7 @@ options       INET            # Internet protocols
 #options       IPSEC_ESP       # IP security (encryption part; define w/IPSEC)
 #options       IPSEC_NAT_T     # IPsec NAT traversal (NAT-T)
 #options       IPSEC_DEBUG     # debug for IP security
-#options       GATEWAY         # IP forwarding + larger mb_map
+#options       GATEWAY         # IP forwarding
 #options       MROUTING        # Multicast routing
 #options       PIM             # Protocol Independent Multicast
 #options       PFIL_HOOKS      # packet filter hooks
Index: sys/arch/hp300/hp300/machdep.c
===================================================================
RCS file: /home/joerg/repo/netbsd/src/sys/arch/hp300/hp300/machdep.c,v
retrieving revision 1.210
diff -u -p -r1.210 machdep.c
--- sys/arch/hp300/hp300/machdep.c      10 Dec 2009 14:13:49 -0000      1.210
+++ sys/arch/hp300/hp300/machdep.c      4 Feb 2010 19:24:33 -0000
@@ -154,7 +154,6 @@ char        machine[] = MACHINE;    /* from <machi
 /* Our exported CPU info; we can have only one. */
 struct cpu_info cpu_info_store;
 
-struct vm_map *mb_map = NULL;
 struct vm_map *phys_map = NULL;
 
 extern paddr_t avail_end;
@@ -345,13 +344,6 @@ cpu_startup(void)
        phys_map = uvm_km_suballoc(kernel_map, &minaddr, &maxaddr,
                                   VM_PHYS_SIZE, 0, false, NULL);
 
-       /*
-        * Finally, allocate mbuf cluster submap.
-        */
-       mb_map = uvm_km_suballoc(kernel_map, &minaddr, &maxaddr,
-                                nmbclusters * mclbytes, VM_MAP_INTRSAFE,
-                                false, NULL);
-
 #ifdef DEBUG
        pmapdebug = opmapdebug;
 #endif
Index: sys/arch/hp700/hp700/machdep.c
===================================================================
RCS file: /home/joerg/repo/netbsd/src/sys/arch/hp700/hp700/machdep.c,v
retrieving revision 1.77
diff -u -p -r1.77 machdep.c
--- sys/arch/hp700/hp700/machdep.c      10 Dec 2009 14:13:49 -0000      1.77
+++ sys/arch/hp700/hp700/machdep.c      4 Feb 2010 19:24:40 -0000
@@ -261,7 +261,6 @@ struct cpu_info cpu_info_store = {
 #endif
 };
 
-struct vm_map *mb_map = NULL;
 struct vm_map *phys_map = NULL;
 
 void delay_init(void);
@@ -887,9 +886,6 @@ cpu_startup(void)
        phys_map = uvm_km_suballoc(kernel_map, &minaddr, &maxaddr,
            VM_PHYS_SIZE, 0, false, NULL);
 
-       mb_map = uvm_km_suballoc(kernel_map, &minaddr, &maxaddr,
-           nmbclusters * mclbytes, VM_MAP_INTRSAFE, false, NULL);
-
 #ifdef PMAPDEBUG
        pmapdebug = opmapdebug;
 #endif
Index: sys/arch/hpcmips/hpcmips/machdep.c
===================================================================
RCS file: /home/joerg/repo/netbsd/src/sys/arch/hpcmips/hpcmips/machdep.c,v
retrieving revision 1.108
diff -u -p -r1.108 machdep.c
--- sys/arch/hpcmips/hpcmips/machdep.c  21 Jan 2010 01:23:14 -0000      1.108
+++ sys/arch/hpcmips/hpcmips/machdep.c  4 Feb 2010 19:24:43 -0000
@@ -219,7 +219,6 @@ static char kernel_path[] = KLOADER_KERN
 #endif /* KLOADER */
 
 /* maps for VM objects */
-struct vm_map *mb_map;
 struct vm_map *phys_map;
 
 /* physical memory */
Index: sys/arch/hppa/include/param.h
===================================================================
RCS file: /home/joerg/repo/netbsd/src/sys/arch/hppa/include/param.h,v
retrieving revision 1.14
diff -u -p -r1.14 param.h
--- sys/arch/hppa/include/param.h       17 Jan 2010 08:24:06 -0000      1.14
+++ sys/arch/hppa/include/param.h       4 Feb 2010 20:12:36 -0000
@@ -87,9 +87,6 @@
 #define        MCLSHIFT        11
 #define        MCLBYTES        (1 << MCLSHIFT) /* large enough for ether MTU */
 #define        MCLOFSET        (MCLBYTES - 1)
-#ifndef NMBCLUSTERS
-#define        NMBCLUSTERS     (2048)          /* cl map size: 1MB */
-#endif
 
 /*
  * Size of kernel malloc arena in logical pages
Index: sys/arch/i386/conf/GENERIC_TINY
===================================================================
RCS file: /home/joerg/repo/netbsd/src/sys/arch/i386/conf/GENERIC_TINY,v
retrieving revision 1.122
diff -u -p -r1.122 GENERIC_TINY
--- sys/arch/i386/conf/GENERIC_TINY     3 Jan 2010 03:53:34 -0000       1.122
+++ sys/arch/i386/conf/GENERIC_TINY     4 Feb 2010 20:12:52 -0000
@@ -43,9 +43,6 @@ options       RTC_OFFSET=0    # hardware clock i
 #options       SYSVSHM         # System V-like memory sharing
 #options       P1003_1B_SEMAPHORE # p1003.1b semaphore support
 
-options        NMBCLUSTERS=256
-
-
 #options       USERCONF        # userconf(4) support
 options        PIPE_SOCKETPAIR # smaller, but slower pipe(2)
 #options       SYSCTL_INCLUDE_DESCR    # Include sysctl descriptions in kernel
Index: sys/arch/i386/conf/INSTALL_TINY
===================================================================
RCS file: /home/joerg/repo/netbsd/src/sys/arch/i386/conf/INSTALL_TINY,v
retrieving revision 1.128
diff -u -p -r1.128 INSTALL_TINY
--- sys/arch/i386/conf/INSTALL_TINY     3 Jan 2010 03:53:34 -0000       1.128
+++ sys/arch/i386/conf/INSTALL_TINY     4 Feb 2010 20:12:48 -0000
@@ -140,7 +140,6 @@ options     INET            # IP + ICMP + TCP + UDP
 options        NVNODE=50
 options        NBUF=20
 options        BUFPAGES=20
-options        NMBCLUSTERS=64
 
 # Kernel root file system and dump configuration.
 config         netbsd  root on ? type ?
Index: sys/arch/i386/i386/machdep.c
===================================================================
RCS file: /home/joerg/repo/netbsd/src/sys/arch/i386/i386/machdep.c,v
retrieving revision 1.681
diff -u -p -r1.681 machdep.c
--- sys/arch/i386/i386/machdep.c        10 Dec 2009 14:13:50 -0000      1.681
+++ sys/arch/i386/i386/machdep.c        4 Feb 2010 19:24:52 -0000
@@ -268,7 +268,6 @@ vaddr_t     idt_vaddr;
 paddr_t        idt_paddr;
 vaddr_t        pentium_idt_vaddr;
 
-struct vm_map *mb_map = NULL;
 struct vm_map *phys_map = NULL;
 
 extern paddr_t avail_start, avail_end;
@@ -493,12 +492,6 @@ cpu_startup(void)
        phys_map = uvm_km_suballoc(kernel_map, &minaddr, &maxaddr,
                                   VM_PHYS_SIZE, 0, false, NULL);
 
-       /*
-        * Allocate mbuf cluster submap.
-        */
-       mb_map = uvm_km_suballoc(kernel_map, &minaddr, &maxaddr,
-           nmbclusters * mclbytes, VM_MAP_INTRSAFE, false, NULL);
-
        /* Say hello. */
        banner();
 
Index: sys/arch/i386/include/param.h
===================================================================
RCS file: /home/joerg/repo/netbsd/src/sys/arch/i386/include/param.h,v
retrieving revision 1.71
diff -u -p -r1.71 param.h
--- sys/arch/i386/include/param.h       10 Mar 2009 20:05:30 -0000      1.71
+++ sys/arch/i386/include/param.h       4 Feb 2010 19:45:24 -0000
@@ -127,16 +127,8 @@
 
 #define        MCLBYTES        (1 << MCLSHIFT) /* size of a m_buf cluster */
 
-#ifndef NMBCLUSTERS
-#if defined(_KERNEL_OPT)
-#include "opt_gateway.h"
-#endif
-
-#ifdef GATEWAY
-#define        NMBCLUSTERS     2048            /* map size, max cluster 
allocation */
-#else
-#define        NMBCLUSTERS     1024            /* map size, max cluster 
allocation */
-#endif
+#ifndef NMBCLUSTERS_MAX
+#define        NMBCLUSTERS_MAX (0x2000000 / MCLBYTES)  /* Limit to 64MB for 
clusters */
 #endif
 
 #ifndef NFS_RSIZE
Index: sys/arch/ia64/ia64/machdep.c
===================================================================
RCS file: /home/joerg/repo/netbsd/src/sys/arch/ia64/ia64/machdep.c,v
retrieving revision 1.22
diff -u -p -r1.22 machdep.c
--- sys/arch/ia64/ia64/machdep.c        10 Dec 2009 14:13:50 -0000      1.22
+++ sys/arch/ia64/ia64/machdep.c        4 Feb 2010 19:24:55 -0000
@@ -130,7 +130,6 @@ vaddr_t ia64_unwindtab;
 vsize_t ia64_unwindtablen;
 #endif
 
-struct vm_map *mb_map = NULL;
 struct vm_map *phys_map = NULL;
 
 void *msgbufaddr;
Index: sys/arch/ia64/include/param.h
===================================================================
RCS file: /home/joerg/repo/netbsd/src/sys/arch/ia64/include/param.h,v
retrieving revision 1.3
diff -u -p -r1.3 param.h
--- sys/arch/ia64/include/param.h       20 Jul 2009 04:41:37 -0000      1.3
+++ sys/arch/ia64/include/param.h       4 Feb 2010 20:08:31 -0000
@@ -112,18 +112,6 @@
 
 #define        MCLBYTES        (1 << MCLSHIFT) /* size of a m_buf cluster */
 
-#ifndef NMBCLUSTERS
-#if defined(_KERNEL_OPT)
-#include "opt_gateway.h"
-#endif
-
-#ifdef GATEWAY
-#define        NMBCLUSTERS     2048            /* map size, max cluster 
allocation */
-#else
-#define        NMBCLUSTERS     1024            /* map size, max cluster 
allocation */
-#endif
-#endif
-
 /*
  * Minimum and maximum sizes of the kernel malloc arena in PAGE_SIZE-sized
  * logical pages.
Index: sys/arch/ia64/stand/common/help.common
===================================================================
RCS file: /home/joerg/repo/netbsd/src/sys/arch/ia64/stand/common/help.common,v
retrieving revision 1.1
diff -u -p -r1.1 help.common
--- sys/arch/ia64/stand/common/help.common      7 Apr 2006 14:21:29 -0000       
1.1
+++ sys/arch/ia64/stand/common/help.common      4 Feb 2010 20:13:14 -0000
@@ -268,7 +268,7 @@
        Various kernel tunable parameters can be overridden by specifying new 
        values in the environment.
 
-       set kern.ipc.nmbclusters=<value>        NMBCLUSTERS
+       set kern.ipc.nmbclusters=<value>
 
                Set the number of mbuf clusters to be allocated.  The value
                cannot be set below the default determined when the kernel
Index: sys/arch/luna68k/include/vmparam.h
===================================================================
RCS file: /home/joerg/repo/netbsd/src/sys/arch/luna68k/include/vmparam.h,v
retrieving revision 1.15
diff -u -p -r1.15 vmparam.h
--- sys/arch/luna68k/include/vmparam.h  11 Dec 2009 18:57:44 -0000      1.15
+++ sys/arch/luna68k/include/vmparam.h  4 Feb 2010 20:14:07 -0000
@@ -138,7 +138,6 @@
 #define VM_MAX_KERNEL_ADDRESS  ((vaddr_t)(0x40000000-PAGE_SIZE*NPTEPG))
 
 /* virtual sizes (bytes) for various kernel submaps */
-#define VM_MBUF_SIZE           (NMBCLUSTERS*MCLBYTES)
 #define VM_PHYS_SIZE           (USRIOSIZE*PAGE_SIZE)
 
 /* # of kernel PT pages (initial only, can grow dynamically) */
Index: sys/arch/luna68k/luna68k/machdep.c
===================================================================
RCS file: /home/joerg/repo/netbsd/src/sys/arch/luna68k/luna68k/machdep.c,v
retrieving revision 1.73
diff -u -p -r1.73 machdep.c
--- sys/arch/luna68k/luna68k/machdep.c  10 Dec 2009 14:13:50 -0000      1.73
+++ sys/arch/luna68k/luna68k/machdep.c  4 Feb 2010 19:26:29 -0000
@@ -95,7 +95,6 @@ char  cpu_model[60];
 /* Our exported CPU info; we can have only one. */  
 struct cpu_info cpu_info_store;
 
-struct vm_map *mb_map = NULL;
 struct vm_map *phys_map = NULL;
 
 int    maxmem;                 /* max memory per process */
@@ -264,13 +263,6 @@ cpu_startup(void)
        phys_map = uvm_km_suballoc(kernel_map, &minaddr, &maxaddr,
                                   VM_PHYS_SIZE, 0, false, NULL);
 
-       /*
-        * Finally, allocate mbuf cluster submap.
-        */
-       mb_map = uvm_km_suballoc(kernel_map, &minaddr, &maxaddr,
-                                nmbclusters * mclbytes, VM_MAP_INTRSAFE,
-                                false, NULL);
-
        format_bytes(pbuf, sizeof(pbuf), ptoa(uvmexp.free));
        printf("avail memory = %s\n", pbuf);
 
Index: sys/arch/m68k/include/param.h
===================================================================
RCS file: /home/joerg/repo/netbsd/src/sys/arch/m68k/include/param.h,v
retrieving revision 1.16
diff -u -p -r1.16 param.h
--- sys/arch/m68k/include/param.h       11 Dec 2009 17:53:22 -0000      1.16
+++ sys/arch/m68k/include/param.h       4 Feb 2010 20:08:21 -0000
@@ -141,18 +141,6 @@
 
 #define        MCLBYTES        (1 << MCLSHIFT) /* size of a m_buf cluster */
 
-#ifndef NMBCLUSTERS
-#if defined(_KERNEL_OPT)
-#include "opt_gateway.h"
-#endif
-
-#ifdef GATEWAY
-# define       NMBCLUSTERS     512     /* map size, max cluster allocation */
-#else
-# define       NMBCLUSTERS     256     /* map size, max cluster allocation */
-#endif
-#endif
-
 /*
  * Mach-derived conversion macros
  */
Index: sys/arch/mac68k/mac68k/machdep.c
===================================================================
RCS file: /home/joerg/repo/netbsd/src/sys/arch/mac68k/mac68k/machdep.c,v
retrieving revision 1.334
diff -u -p -r1.334 machdep.c
--- sys/arch/mac68k/mac68k/machdep.c    10 Dec 2009 14:13:50 -0000      1.334
+++ sys/arch/mac68k/mac68k/machdep.c    4 Feb 2010 19:25:22 -0000
@@ -218,7 +218,6 @@ struct mac68k_video mac68k_video;
 int    (*mac68k_bell_callback)(void *, int, int, int);
 void * mac68k_bell_cookie;
 
-struct vm_map *mb_map = NULL;
 struct vm_map *phys_map = NULL;
 
 int    maxmem;                 /* max memory per process */
@@ -449,12 +448,6 @@ cpu_startup(void)
        phys_map = uvm_km_suballoc(kernel_map, &minaddr, &maxaddr,
            VM_PHYS_SIZE, 0, false, NULL);
 
-       /*
-        * Finally, allocate mbuf cluster submap.
-        */
-       mb_map = uvm_km_suballoc(kernel_map, &minaddr, &maxaddr,
-           nmbclusters * mclbytes, VM_MAP_INTRSAFE, false, NULL);
-
        format_bytes(pbuf, sizeof(pbuf), ptoa(uvmexp.free));
        printf("avail memory = %s\n", pbuf);
 
Index: sys/arch/mips/include/mips_param.h
===================================================================
RCS file: /home/joerg/repo/netbsd/src/sys/arch/mips/include/mips_param.h,v
retrieving revision 1.26
diff -u -p -r1.26 mips_param.h
--- sys/arch/mips/include/mips_param.h  14 Dec 2009 00:46:05 -0000      1.26
+++ sys/arch/mips/include/mips_param.h  4 Feb 2010 20:08:04 -0000
@@ -124,15 +124,4 @@
 
 #define        MCLBYTES        (1 << MCLSHIFT) /* size of a m_buf cluster */
 
-#ifndef NMBCLUSTERS
-#if defined(_KERNEL_OPT)
-#include "opt_gateway.h"
-#endif
-
-#ifdef GATEWAY
-#define        NMBCLUSTERS     2048            /* map size, max cluster 
allocation */
-#else
-#define        NMBCLUSTERS     1024            /* map size, max cluster 
allocation */
-#endif
-#endif
 #endif
Index: sys/arch/mipsco/mipsco/machdep.c
===================================================================
RCS file: /home/joerg/repo/netbsd/src/sys/arch/mipsco/mipsco/machdep.c,v
retrieving revision 1.70
diff -u -p -r1.70 machdep.c
--- sys/arch/mipsco/mipsco/machdep.c    16 Dec 2009 23:19:07 -0000      1.70
+++ sys/arch/mipsco/mipsco/machdep.c    4 Feb 2010 19:26:31 -0000
@@ -142,7 +142,6 @@ struct cpu_info cpu_info_store;
 
 /* maps for VM objects */
 
-struct vm_map *mb_map = NULL;
 struct vm_map *phys_map = NULL;
 
 int    physmem;                /* max supported memory, changes to actual */
Index: sys/arch/mvme68k/mvme68k/machdep.c
===================================================================
RCS file: /home/joerg/repo/netbsd/src/sys/arch/mvme68k/mvme68k/machdep.c,v
retrieving revision 1.141
diff -u -p -r1.141 machdep.c
--- sys/arch/mvme68k/mvme68k/machdep.c  10 Dec 2009 14:13:51 -0000      1.141
+++ sys/arch/mvme68k/mvme68k/machdep.c  4 Feb 2010 19:26:41 -0000
@@ -149,7 +149,6 @@ char        machine[] = MACHINE;    /* from <machi
 /* Our exported CPU info; we can have only one. */  
 struct cpu_info cpu_info_store;
 
-struct vm_map *mb_map = NULL;
 struct vm_map *phys_map = NULL;
 
 /*
@@ -509,12 +508,6 @@ cpu_startup(void)
        phys_map = uvm_km_suballoc(kernel_map, &minaddr, &maxaddr,
            VM_PHYS_SIZE, 0, false, NULL);
 
-       /*
-        * Finally, allocate mbuf cluster submap.
-        */
-       mb_map = uvm_km_suballoc(kernel_map, &minaddr, &maxaddr,
-           nmbclusters * mclbytes, VM_MAP_INTRSAFE, false, NULL);
-
 #ifdef DEBUG
        pmapdebug = opmapdebug;
 #endif
Index: sys/arch/news68k/news68k/machdep.c
===================================================================
RCS file: /home/joerg/repo/netbsd/src/sys/arch/news68k/news68k/machdep.c,v
retrieving revision 1.84
diff -u -p -r1.84 machdep.c
--- sys/arch/news68k/news68k/machdep.c  10 Dec 2009 14:13:51 -0000      1.84
+++ sys/arch/news68k/news68k/machdep.c  4 Feb 2010 19:26:48 -0000
@@ -142,7 +142,6 @@ char        machine[] = MACHINE;    /* from <machi
 /* Our exported CPU info; we can have only one. */
 struct cpu_info cpu_info_store;
 
-struct vm_map *mb_map = NULL;
 struct vm_map *phys_map = NULL;
 
 int    maxmem;                 /* max memory per process */
@@ -276,12 +275,6 @@ cpu_startup(void)
        phys_map = uvm_km_suballoc(kernel_map, &minaddr, &maxaddr,
            VM_PHYS_SIZE, 0, false, NULL);
 
-       /*
-        * Finally, allocate mbuf cluster submap.
-        */
-       mb_map = uvm_km_suballoc(kernel_map, &minaddr, &maxaddr,
-           nmbclusters * mclbytes, VM_MAP_INTRSAFE, false, NULL);
-
 #ifdef DEBUG
        pmapdebug = opmapdebug;
 #endif
Index: sys/arch/newsmips/newsmips/machdep.c
===================================================================
RCS file: /home/joerg/repo/netbsd/src/sys/arch/newsmips/newsmips/machdep.c,v
retrieving revision 1.107
diff -u -p -r1.107 machdep.c
--- sys/arch/newsmips/newsmips/machdep.c        17 Dec 2009 05:29:56 -0000      
1.107
+++ sys/arch/newsmips/newsmips/machdep.c        4 Feb 2010 19:26:52 -0000
@@ -144,7 +144,6 @@ struct cpu_info cpu_info_store;
 
 /* maps for VM objects */
 
-struct vm_map *mb_map = NULL;
 struct vm_map *phys_map = NULL;
 
 char *bootinfo = NULL;         /* pointer to bootinfo structure */
Index: sys/arch/next68k/next68k/machdep.c
===================================================================
RCS file: /home/joerg/repo/netbsd/src/sys/arch/next68k/next68k/machdep.c,v
retrieving revision 1.97
diff -u -p -r1.97 machdep.c
--- sys/arch/next68k/next68k/machdep.c  10 Dec 2009 14:13:51 -0000      1.97
+++ sys/arch/next68k/next68k/machdep.c  4 Feb 2010 19:26:59 -0000
@@ -160,7 +160,6 @@ char        machine[] = MACHINE;    /* from <machi
 /* Our exported CPU info; we can have only one. */  
 struct cpu_info cpu_info_store;
 
-struct vm_map *mb_map = NULL;
 struct vm_map *phys_map = NULL;
 
 paddr_t msgbufpa;              /* PA of message buffer */
@@ -344,13 +343,6 @@ cpu_startup(void)
        phys_map = uvm_km_suballoc(kernel_map, &minaddr, &maxaddr,
                                 VM_PHYS_SIZE, 0, false, NULL);
 
-       /*
-        * Finally, allocate mbuf cluster submap.
-        */
-       mb_map = uvm_km_suballoc(kernel_map, &minaddr, &maxaddr,
-                                nmbclusters * mclbytes, VM_MAP_INTRSAFE,
-                                false, NULL);
-
 #ifdef DEBUG
        pmapdebug = opmapdebug;
 #endif
Index: sys/arch/ofppc/conf/GENERIC
===================================================================
RCS file: /home/joerg/repo/netbsd/src/sys/arch/ofppc/conf/GENERIC,v
retrieving revision 1.122
diff -u -p -r1.122 GENERIC
--- sys/arch/ofppc/conf/GENERIC 5 Dec 2009 20:11:16 -0000       1.122
+++ sys/arch/ofppc/conf/GENERIC 4 Feb 2010 20:14:15 -0000
@@ -133,7 +133,6 @@ options     PFIL_HOOKS      # pfil(9) packet fil
 options        IPFILTER_LOG    # ipmon(8) log support
 options        IPFILTER_LOOKUP # ippool(8) support
 #options       IPFILTER_DEFAULT_BLOCK  # block all packets by default
-options        NMBCLUSTERS=1024
 #options       TCP_DEBUG       # Record last TCP_NDEBUG packets with SO_DEBUG
 
 #options       ALTQ            # Manipulate network interfaces' output queues
Index: sys/arch/ofppc/conf/GENERIC.MP
===================================================================
RCS file: /home/joerg/repo/netbsd/src/sys/arch/ofppc/conf/GENERIC.MP,v
retrieving revision 1.6
diff -u -p -r1.6 GENERIC.MP
--- sys/arch/ofppc/conf/GENERIC.MP      5 Dec 2009 20:11:16 -0000       1.6
+++ sys/arch/ofppc/conf/GENERIC.MP      4 Feb 2010 20:14:13 -0000
@@ -138,7 +138,6 @@ options     PFIL_HOOKS      # pfil(9) packet fil
 options        IPFILTER_LOG    # ipmon(8) log support
 options        IPFILTER_LOOKUP # ippool(8) support
 #options       IPFILTER_DEFAULT_BLOCK  # block all packets by default
-options        NMBCLUSTERS=1024
 #options       TCP_DEBUG       # Record last TCP_NDEBUG packets with SO_DEBUG
 
 #options       ALTQ            # Manipulate network interfaces' output queues
Index: sys/arch/pmax/pmax/machdep.c
===================================================================
RCS file: /home/joerg/repo/netbsd/src/sys/arch/pmax/pmax/machdep.c,v
retrieving revision 1.238
diff -u -p -r1.238 machdep.c
--- sys/arch/pmax/pmax/machdep.c        14 Dec 2009 00:46:11 -0000      1.238
+++ sys/arch/pmax/pmax/machdep.c        4 Feb 2010 19:27:01 -0000
@@ -132,7 +132,6 @@ unsigned int ssir;                  /* simulated interr
 struct cpu_info cpu_info_store;
 
 /* maps for VM objects */
-struct vm_map *mb_map = NULL;
 struct vm_map *phys_map = NULL;
 
 int            systype;                /* mother board type */
Index: sys/arch/powerpc/include/param.h
===================================================================
RCS file: /home/joerg/repo/netbsd/src/sys/arch/powerpc/include/param.h,v
retrieving revision 1.20
diff -u -p -r1.20 param.h
--- sys/arch/powerpc/include/param.h    28 Aug 2006 13:43:35 -0000      1.20
+++ sys/arch/powerpc/include/param.h    4 Feb 2010 20:07:18 -0000
@@ -98,19 +98,6 @@
 #endif
 #define        MCLBYTES        (1 << MCLSHIFT) /* size of a m_buf cluster */
 
-#ifndef NMBCLUSTERS
-
-#if defined(_KERNEL_OPT)
-#include "opt_gateway.h"
-#endif
-
-#ifdef GATEWAY
-#define        NMBCLUSTERS     2048            /* map size, max cluster 
allocation */
-#else
-#define        NMBCLUSTERS     1024            /* map size, max cluster 
allocation */
-#endif
-#endif
-
 /*
  * Minimum and maximum sizes of the kernel malloc arena in PAGE_SIZE-sized
  * logical pages.
Index: sys/arch/powerpc/oea/oea_machdep.c
===================================================================
RCS file: /home/joerg/repo/netbsd/src/sys/arch/powerpc/oea/oea_machdep.c,v
retrieving revision 1.51
diff -u -p -r1.51 oea_machdep.c
--- sys/arch/powerpc/oea/oea_machdep.c  27 Nov 2009 03:23:12 -0000      1.51
+++ sys/arch/powerpc/oea/oea_machdep.c  4 Feb 2010 19:27:17 -0000
@@ -88,7 +88,6 @@ __KERNEL_RCSID(0, "$NetBSD: oea_machdep.
 char machine[] = MACHINE;              /* from <machine/param.h> */
 char machine_arch[] = MACHINE_ARCH;    /* from <machine/param.h> */
 
-struct vm_map *mb_map = NULL;
 struct vm_map *phys_map = NULL;
 
 /*
@@ -786,16 +785,6 @@ oea_startup(const char *model)
        phys_map = uvm_km_suballoc(kernel_map, &minaddr, &maxaddr,
                                 VM_PHYS_SIZE, 0, false, NULL);
 
-#ifndef PMAP_MAP_POOLPAGE
-       /*
-        * No need to allocate an mbuf cluster submap.  Mbuf clusters
-        * are allocated via the pool allocator, and we use direct-mapped
-        * pool pages.
-        */
-       mb_map = uvm_km_suballoc(kernel_map, &minaddr, &maxaddr,
-           mclbytes*nmbclusters, VM_MAP_INTRSAFE, false, NULL);
-#endif
-
        format_bytes(pbuf, sizeof(pbuf), ptoa(uvmexp.free));
        printf("avail memory = %s\n", pbuf);
 }
Index: sys/arch/sbmips/sbmips/machdep.c
===================================================================
RCS file: /home/joerg/repo/netbsd/src/sys/arch/sbmips/sbmips/machdep.c,v
retrieving revision 1.46
diff -u -p -r1.46 machdep.c
--- sys/arch/sbmips/sbmips/machdep.c    16 Dec 2009 19:02:03 -0000      1.46
+++ sys/arch/sbmips/sbmips/machdep.c    4 Feb 2010 19:27:21 -0000
@@ -125,7 +125,6 @@ void        *ksym_start, *ksym_end;
 struct cpu_info cpu_info_store;
 
 /* Maps for VM objects. */
-struct vm_map *mb_map = NULL;
 struct vm_map *phys_map = NULL;
 
 int    physmem;                /* Total physical memory */
Index: sys/arch/sgimips/sgimips/machdep.c
===================================================================
RCS file: /home/joerg/repo/netbsd/src/sys/arch/sgimips/sgimips/machdep.c,v
retrieving revision 1.132
diff -u -p -r1.132 machdep.c
--- sys/arch/sgimips/sgimips/machdep.c  16 Dec 2009 23:19:07 -0000      1.132
+++ sys/arch/sgimips/sgimips/machdep.c  4 Feb 2010 19:27:34 -0000
@@ -116,7 +116,6 @@ struct sgimips_intrhand intrtab[NINTR];
 struct cpu_info cpu_info_store;
 
 /* Maps for VM objects. */
-struct vm_map *mb_map = NULL;
 struct vm_map *phys_map = NULL;
 
 int mach_type = 0;     /* IPxx type */
Index: sys/arch/sh3/include/param.h
===================================================================
RCS file: /home/joerg/repo/netbsd/src/sys/arch/sh3/include/param.h,v
retrieving revision 1.19
diff -u -p -r1.19 param.h
--- sys/arch/sh3/include/param.h        26 Oct 2007 22:24:51 -0000      1.19
+++ sys/arch/sh3/include/param.h        4 Feb 2010 20:07:02 -0000
@@ -104,18 +104,6 @@
 
 #define        MCLBYTES        (1 << MCLSHIFT) /* size of a m_buf cluster */
 
-#ifndef NMBCLUSTERS
-#if defined(_KERNEL_OPT)
-#include "opt_gateway.h"
-#endif
-
-#ifdef GATEWAY
-#define        NMBCLUSTERS     512             /* map size, max cluster 
allocation */
-#else
-#define        NMBCLUSTERS     256             /* map size, max cluster 
allocation */
-#endif
-#endif
-
 /*
  * Minimum and maximum sizes of the kernel malloc arena in PAGE_SIZE-sized
  * logical pages.
Index: sys/arch/sh3/sh3/sh3_machdep.c
===================================================================
RCS file: /home/joerg/repo/netbsd/src/sys/arch/sh3/sh3/sh3_machdep.c,v
retrieving revision 1.85
diff -u -p -r1.85 sh3_machdep.c
--- sys/arch/sh3/sh3/sh3_machdep.c      10 Dec 2009 14:13:51 -0000      1.85
+++ sys/arch/sh3/sh3/sh3_machdep.c      4 Feb 2010 19:27:37 -0000
@@ -110,7 +110,6 @@ int cpu_arch;
 int cpu_product;
 char cpu_model[120];
 
-struct vm_map *mb_map;
 struct vm_map *phys_map;
 
 struct pcb *curpcb;
Index: sys/arch/shark/conf/GENERIC
===================================================================
RCS file: /home/joerg/repo/netbsd/src/sys/arch/shark/conf/GENERIC,v
retrieving revision 1.87
diff -u -p -r1.87 GENERIC
--- sys/arch/shark/conf/GENERIC 18 Jan 2010 23:40:06 -0000      1.87
+++ sys/arch/shark/conf/GENERIC 4 Feb 2010 20:14:25 -0000
@@ -17,7 +17,6 @@ maxusers      32
 options        RTC_OFFSET=0    # hardware clock is this many mins. west of GMT
 options        HZ=64
 #options       NTP             # NTP phase/frequency locked loop
-options        NMBCLUSTERS=1024 # XXX, temporarily required
 #options       BOOT_QUIETLY    # twiddle instead of normal boot msg output
 
 # CPU options
Index: sys/arch/shark/conf/INSTALL
===================================================================
RCS file: /home/joerg/repo/netbsd/src/sys/arch/shark/conf/INSTALL,v
retrieving revision 1.42
diff -u -p -r1.42 INSTALL
--- sys/arch/shark/conf/INSTALL 5 Dec 2009 20:11:17 -0000       1.42
+++ sys/arch/shark/conf/INSTALL 4 Feb 2010 20:14:22 -0000
@@ -16,7 +16,6 @@ maxusers      32
 options        RTC_OFFSET=0    # hardware clock is this many mins. west of GMT
 options        HZ=64
 #options       NTP             # NTP phase/frequency locked loop
-options        NMBCLUSTERS=1024 # XXX, temporarily required
 #options       BOOT_QUIETLY    # twiddle instead of normal boot msg output
 
 # CPU options
Index: sys/arch/sparc/include/param.h
===================================================================
RCS file: /home/joerg/repo/netbsd/src/sys/arch/sparc/include/param.h,v
retrieving revision 1.66
diff -u -p -r1.66 param.h
--- sys/arch/sparc/include/param.h      28 Aug 2006 13:43:35 -0000      1.66
+++ sys/arch/sparc/include/param.h      4 Feb 2010 20:06:34 -0000
@@ -125,18 +125,6 @@ extern int nbpg, pgofset, pgshift;
 
 #define        MCLBYTES        (1 << MCLSHIFT) /* size of a m_buf cluster */
 
-#ifndef NMBCLUSTERS
-#if defined(_KERNEL_OPT)
-#include "opt_gateway.h"
-#endif
-
-#ifdef GATEWAY
-#define        NMBCLUSTERS     512             /* map size, max cluster 
allocation */
-#else
-#define        NMBCLUSTERS     256             /* map size, max cluster 
allocation */
-#endif
-#endif
-
 /*
  * Minimum and maximum sizes of the kernel malloc arena in PAGE_SIZE-sized
  * logical pages.
Index: sys/arch/sparc/sparc/machdep.c
===================================================================
RCS file: /home/joerg/repo/netbsd/src/sys/arch/sparc/sparc/machdep.c,v
retrieving revision 1.301
diff -u -p -r1.301 machdep.c
--- sys/arch/sparc/sparc/machdep.c      26 Jan 2010 03:06:01 -0000      1.301
+++ sys/arch/sparc/sparc/machdep.c      4 Feb 2010 19:29:43 -0000
@@ -135,7 +135,6 @@ __KERNEL_RCSID(0, "$NetBSD: machdep.c,v 
 #include <sparc/dev/power.h>
 #endif
 
-struct vm_map *mb_map = NULL;
 extern paddr_t avail_end;
 
 int    physmem;
@@ -326,12 +325,6 @@ cpu_startup(void)
                        panic("unable to allocate DVMA map");
        }
 
-       /*
-        * Finally, allocate mbuf cluster submap.
-        */
-        mb_map = uvm_km_suballoc(kernel_map, &minaddr, &maxaddr,
-           nmbclusters * mclbytes, VM_MAP_INTRSAFE, false, NULL);
-
 #ifdef DEBUG
        pmapdebug = opmapdebug;
 #endif
Index: sys/arch/sparc64/include/param.h
===================================================================
RCS file: /home/joerg/repo/netbsd/src/sys/arch/sparc64/include/param.h,v
retrieving revision 1.43
diff -u -p -r1.43 param.h
--- sys/arch/sparc64/include/param.h    26 Aug 2008 11:37:56 -0000      1.43
+++ sys/arch/sparc64/include/param.h    4 Feb 2010 20:06:11 -0000
@@ -208,18 +208,6 @@ extern int nbpg, pgofset, pgshift;
 
 #define        MCLBYTES        (1 << MCLSHIFT) /* size of a m_buf cluster */
 
-#ifndef NMBCLUSTERS
-#if defined(_KERNEL_OPT)
-#include "opt_gateway.h"
-#endif
-
-#ifdef GATEWAY
-#define        NMBCLUSTERS     2048            /* map size, max cluster 
allocation */
-#else
-#define        NMBCLUSTERS     1024            /* map size, max cluster 
allocation */
-#endif
-#endif
-
 #define MSGBUFSIZE     NBPG
 
 /*
Index: sys/arch/sparc64/sparc64/machdep.c
===================================================================
RCS file: /home/joerg/repo/netbsd/src/sys/arch/sparc64/sparc64/machdep.c,v
retrieving revision 1.250
diff -u -p -r1.250 machdep.c
--- sys/arch/sparc64/sparc64/machdep.c  7 Dec 2009 11:28:37 -0000       1.250
+++ sys/arch/sparc64/sparc64/machdep.c  4 Feb 2010 19:30:49 -0000
@@ -146,7 +146,6 @@ int sigpid = 0;
 #endif
 #endif
 
-struct vm_map *mb_map = NULL;
 extern vaddr_t avail_end;
 
 int    physmem;
@@ -196,14 +195,6 @@ cpu_startup(void)
        format_bytes(pbuf, sizeof(pbuf), ctob((uint64_t)physmem));
        printf("total memory = %s\n", pbuf);
 
-       minaddr = 0;
-
-       /*
-        * Finally, allocate mbuf cluster submap.
-        */
-        mb_map = uvm_km_suballoc(kernel_map, &minaddr, &maxaddr,
-           nmbclusters * mclbytes, VM_MAP_INTRSAFE, FALSE, NULL);
-
 #ifdef DEBUG
        pmapdebug = opmapdebug;
 #endif
Index: sys/arch/sun2/include/param.h
===================================================================
RCS file: /home/joerg/repo/netbsd/src/sys/arch/sun2/include/param.h,v
retrieving revision 1.11
diff -u -p -r1.11 param.h
--- sys/arch/sun2/include/param.h       11 Dec 2009 13:56:15 -0000      1.11
+++ sys/arch/sun2/include/param.h       4 Feb 2010 20:00:28 -0000
@@ -106,11 +106,9 @@
 #define        MAXPHYS         0xe000
 
 /*
- * XXX fredette - we force a small number of mbuf clusters and cluster
- * size to help me debug this on my low-memory machine.  These should
- * go away at some point.
+ * XXX fredette - we force a small cluster size to help me debug
+ * this on my low-memory machine.  These should go away at some point.
  */
-#define        NMBCLUSTERS     64      /* map size, max cluster allocation */
 #define MCLSHIFT       10
 
 /*
Index: sys/arch/sun2/sun2/machdep.c
===================================================================
RCS file: /home/joerg/repo/netbsd/src/sys/arch/sun2/sun2/machdep.c,v
retrieving revision 1.64
diff -u -p -r1.64 machdep.c
--- sys/arch/sun2/sun2/machdep.c        10 Dec 2009 14:13:52 -0000      1.64
+++ sys/arch/sun2/sun2/machdep.c        4 Feb 2010 19:30:59 -0000
@@ -234,7 +234,6 @@ extern u_int bufpages;
 /* Our exported CPU info; we can have only one. */  
 struct cpu_info cpu_info_store;
 
-struct vm_map *mb_map = NULL;
 struct vm_map *phys_map = NULL;
 
 int    physmem;
@@ -345,13 +344,6 @@ cpu_startup(void)
        phys_map = uvm_km_suballoc(kernel_map, &minaddr, &maxaddr,
                                   VM_PHYS_SIZE, 0, false, NULL);
 
-       /*
-        * Finally, allocate mbuf cluster submap.
-        */
-       mb_map = uvm_km_suballoc(kernel_map, &minaddr, &maxaddr,
-                                nmbclusters * mclbytes, VM_MAP_INTRSAFE,
-                                false, NULL);
-
        format_bytes(pbuf, sizeof(pbuf), ptoa(uvmexp.free));
        printf("avail memory = %s\n", pbuf);
 
Index: sys/arch/sun3/sun3/machdep.c
===================================================================
RCS file: /home/joerg/repo/netbsd/src/sys/arch/sun3/sun3/machdep.c,v
retrieving revision 1.196
diff -u -p -r1.196 machdep.c
--- sys/arch/sun3/sun3/machdep.c        10 Dec 2009 14:13:52 -0000      1.196
+++ sys/arch/sun3/sun3/machdep.c        4 Feb 2010 19:31:32 -0000
@@ -142,7 +142,6 @@ extern char etext[];
 /* Our exported CPU info; we can have only one. */  
 struct cpu_info cpu_info_store;
 
-struct vm_map *mb_map = NULL;
 struct vm_map *phys_map = NULL;
 
 int    physmem;
@@ -257,13 +256,6 @@ cpu_startup(void)
        phys_map = uvm_km_suballoc(kernel_map, &minaddr, &maxaddr,
                                   VM_PHYS_SIZE, 0, false, NULL);
 
-       /*
-        * Finally, allocate mbuf cluster submap.
-        */
-       mb_map = uvm_km_suballoc(kernel_map, &minaddr, &maxaddr,
-                                nmbclusters * mclbytes, VM_MAP_INTRSAFE,
-                                false, NULL);
-
        format_bytes(pbuf, sizeof(pbuf), ptoa(uvmexp.free));
        printf("avail memory = %s\n", pbuf);
 
Index: sys/arch/sun3/sun3x/machdep.c
===================================================================
RCS file: /home/joerg/repo/netbsd/src/sys/arch/sun3/sun3x/machdep.c,v
retrieving revision 1.122
diff -u -p -r1.122 machdep.c
--- sys/arch/sun3/sun3x/machdep.c       10 Dec 2009 14:13:52 -0000      1.122
+++ sys/arch/sun3/sun3x/machdep.c       4 Feb 2010 19:31:40 -0000
@@ -139,7 +139,6 @@ extern char etext[];
 /* Our exported CPU info; we can have only one. */  
 struct cpu_info cpu_info_store;
 
-struct vm_map *mb_map = NULL;
 struct vm_map *phys_map = NULL;
 
 int    physmem;
@@ -257,13 +256,6 @@ cpu_startup(void)
        phys_map = uvm_km_suballoc(kernel_map, &minaddr, &maxaddr,
                                   VM_PHYS_SIZE, 0, false, NULL);
 
-       /*
-        * Finally, allocate mbuf cluster submap.
-        */
-       mb_map = uvm_km_suballoc(kernel_map, &minaddr, &maxaddr,
-                                nmbclusters * mclbytes, VM_MAP_INTRSAFE,
-                                false, NULL);
-
        format_bytes(pbuf, sizeof(pbuf), ptoa(uvmexp.free));
        printf("avail memory = %s\n", pbuf);
 
Index: sys/arch/usermode/dev/cpu.c
===================================================================
RCS file: /home/joerg/repo/netbsd/src/sys/arch/usermode/dev/cpu.c,v
retrieving revision 1.6
diff -u -p -r1.6 cpu.c
--- sys/arch/usermode/dev/cpu.c 27 Nov 2009 03:23:14 -0000      1.6
+++ sys/arch/usermode/dev/cpu.c 4 Feb 2010 19:31:57 -0000
@@ -307,18 +307,12 @@ cpu_initclocks(void)
 void
 cpu_startup(void)
 {
-       extern struct vm_map *mb_map;
-       vaddr_t minaddr, maxaddr;
        char pbuf[9];
 
        printf("%s%s", copyright, version);
        format_bytes(pbuf, sizeof(pbuf), ptoa(physmem));
        printf("total memory = %s\n", pbuf);
 
-       minaddr = 0;
-       mb_map = uvm_km_suballoc(kernel_map, &minaddr, &maxaddr,
-           nmbclusters * mclbytes, VM_MAP_INTRSAFE, false, NULL);
-
        format_bytes(pbuf, sizeof(pbuf), ptoa(uvmexp.free));
        printf("avail memory = %s\n", pbuf);
 }
Index: sys/arch/usermode/usermode/machdep.c
===================================================================
RCS file: /home/joerg/repo/netbsd/src/sys/arch/usermode/usermode/machdep.c,v
retrieving revision 1.8
diff -u -p -r1.8 machdep.c
--- sys/arch/usermode/usermode/machdep.c        10 Dec 2009 14:13:52 -0000      
1.8
+++ sys/arch/usermode/usermode/machdep.c        4 Feb 2010 19:32:03 -0000
@@ -47,7 +47,6 @@ char machine_arch[] = "usermode";
 int            usermode_x = IPL_NONE;
 /* XXX */
 int            physmem = MEMSIZE * 1024 / PAGE_SIZE;
-struct vm_map  *mb_map = NULL;
 
 void   main(int argc, char *argv[]);
 
Index: sys/arch/vax/include/param.h
===================================================================
RCS file: /home/joerg/repo/netbsd/src/sys/arch/vax/include/param.h,v
retrieving revision 1.57
diff -u -p -r1.57 param.h
--- sys/arch/vax/include/param.h        21 Nov 2009 04:45:39 -0000      1.57
+++ sys/arch/vax/include/param.h        4 Feb 2010 20:06:22 -0000
@@ -112,18 +112,6 @@
 
 #define        MCLBYTES        (1 << MCLSHIFT) /* size of a m_buf cluster */
 
-#ifndef NMBCLUSTERS
-#if defined(_KERNEL_OPT)
-#include "opt_gateway.h"
-#endif
-
-#ifdef GATEWAY
-#define        NMBCLUSTERS     512             /* map size, max cluster 
allocation */
-#else
-#define        NMBCLUSTERS     256             /* map size, max cluster 
allocation */
-#endif
-#endif
-
 /*
  * Minimum and maximum sizes of the kernel malloc arena in PAGE_SIZE-sized
  * logical pages.
Index: sys/arch/vax/vax/machdep.c
===================================================================
RCS file: /home/joerg/repo/netbsd/src/sys/arch/vax/vax/machdep.c,v
retrieving revision 1.178
diff -u -p -r1.178 machdep.c
--- sys/arch/vax/vax/machdep.c  21 Nov 2009 04:45:39 -0000      1.178
+++ sys/arch/vax/vax/machdep.c  4 Feb 2010 19:30:34 -0000
@@ -163,7 +163,6 @@ static long iomap_ex_storage[EXTENT_FIXE
 static struct extent *iomap_ex;
 static int iomap_ex_malloc_safe;
 
-struct vm_map *mb_map = NULL;
 struct vm_map *phys_map = NULL;
 
 #ifdef DEBUG
Index: sys/arch/x68k/x68k/machdep.c
===================================================================
RCS file: /home/joerg/repo/netbsd/src/sys/arch/x68k/x68k/machdep.c,v
retrieving revision 1.164
diff -u -p -r1.164 machdep.c
--- sys/arch/x68k/x68k/machdep.c        10 Dec 2009 14:13:53 -0000      1.164
+++ sys/arch/x68k/x68k/machdep.c        4 Feb 2010 19:32:14 -0000
@@ -151,7 +151,6 @@ char        machine[] = MACHINE;    /* from <machi
 /* Our exported CPU info; we can have only one. */
 struct cpu_info cpu_info_store;
 
-struct vm_map *mb_map = NULL;
 struct vm_map *phys_map = NULL;
 
 extern paddr_t avail_start, avail_end;
@@ -297,13 +296,6 @@ cpu_startup(void)
        phys_map = uvm_km_suballoc(kernel_map, &minaddr, &maxaddr,
                                   VM_PHYS_SIZE, 0, false, NULL);
 
-       /*
-        * Finally, allocate mbuf cluster submap.
-        */
-       mb_map = uvm_km_suballoc(kernel_map, &minaddr, &maxaddr,
-                                nmbclusters * mclbytes, VM_MAP_INTRSAFE,
-                                false, NULL);
-
 #ifdef DEBUG
        pmapdebug = opmapdebug;
 #endif
Index: sys/conf/param.c
===================================================================
RCS file: /home/joerg/repo/netbsd/src/sys/conf/param.c,v
retrieving revision 1.62
diff -u -p -r1.62 param.c
--- sys/conf/param.c    3 May 2009 21:25:44 -0000       1.62
+++ sys/conf/param.c    4 Feb 2010 19:59:51 -0000
@@ -43,7 +43,6 @@ __KERNEL_RCSID(0, "$NetBSD: param.c,v 1.
 #include "opt_rtc_offset.h"
 #include "opt_sysv.h"
 #include "opt_sysvparam.h"
-#include "opt_nmbclusters.h"
 #include "opt_multiprocessor.h"
 
 #include <sys/param.h>
@@ -135,7 +134,7 @@ size_t      coherency_unit = ALIGNBYTES + 1;
  * Various mbuf-related parameters.  These can also be changed at run-time
  * with sysctl.
  */
-int    nmbclusters = NMBCLUSTERS;
+int    nmbclusters = 0;
 
 #ifndef MBLOWAT
 #define        MBLOWAT         16
Index: sys/kern/uipc_mbuf.c
===================================================================
RCS file: /home/joerg/repo/netbsd/src/sys/kern/uipc_mbuf.c,v
retrieving revision 1.132
diff -u -p -r1.132 uipc_mbuf.c
--- sys/kern/uipc_mbuf.c        5 Apr 2009 16:31:21 -0000       1.132
+++ sys/kern/uipc_mbuf.c        4 Feb 2010 21:34:51 -0000
@@ -65,6 +65,7 @@
 __KERNEL_RCSID(0, "$NetBSD: uipc_mbuf.c,v 1.132 2009/04/05 16:31:21 bouyer Exp 
$");
 
 #include "opt_mbuftrace.h"
+#include "opt_nmbclusters.h"
 #include "opt_ddb.h"
 
 #include <sys/param.h>
@@ -122,7 +123,7 @@ static int m_copyback0(struct mbuf **, i
 #define        M_COPYBACK0_EXTEND      0x0008  /* extend chain */
 
 static const char mclpool_warnmsg[] =
-    "WARNING: mclpool limit reached; increase NMBCLUSTERS";
+    "WARNING: mclpool limit reached; increase kern.mbuf.nmbclusters";
 
 MALLOC_DEFINE(M_MBUF, "mbuf", "mbuf");
 
@@ -157,6 +158,25 @@ do {                                                       
                \
        MCLREFDEBUGN((n), __FILE__, __LINE__);                          \
 } while (/* CONSTCOND */ 0)
 
+static int
+nmbclusters_limit(void)
+{
+#ifdef PMAP_MAP_POOLPAGE
+       /* direct mapping, doesn't use space in kmem_map */
+       vsize_t max_size = physmem / 4;
+#else
+       vsize_t max_size = MIN(physmem / 4, nkmempages / 2);
+#endif
+
+       max_size = max_size * PAGE_SIZE / MCLBYTES;
+
+#ifdef NMBCLUSTERS
+       return MIN(max_size, NMBCLUSTERS);
+#else
+       return max_size;
+#endif
+}
+
 /*
  * Initialize the mbuf allocator.
  */
@@ -169,7 +189,7 @@ mbinit(void)
 
        sysctl_kern_mbuf_setup();
 
-       mclpool_allocator.pa_backingmap = mb_map;
+       mclpool_allocator.pa_backingmap = kmem_map;
 
        mb_cache = pool_cache_init(msize, 0, 0, 0, "mbpl",
            NULL, IPL_VM, mb_ctor, NULL, NULL);
@@ -183,6 +203,17 @@ mbinit(void)
        pool_cache_set_drain_hook(mcl_cache, m_reclaim, NULL);
 
        /*
+        * Set an arbitrary default limit on the number of mbuf clusters.
+        */
+#ifdef NMBCLUSTERS
+       nmbclusters = nmbclusters_limit();
+#else
+       nmbclusters = MAX(1024,
+           (vsize_t)physmem * PAGE_SIZE / MCLBYTES / 16);
+       nmbclusters = MIN(nmbclusters, nmbclusters_limit());
+#endif
+
+       /*
         * Set the hard limit on the mclpool to the number of
         * mbuf clusters the kernel is to support.  Log the limit
         * reached message max once a minute.
@@ -215,8 +246,8 @@ mbinit(void)
 }
 
 /*
- * sysctl helper routine for the kern.mbuf subtree.  nmbclusters may
- * or may not be writable, and mblowat and mcllowat need range
+ * sysctl helper routine for the kern.mbuf subtree.
+ * nmbclusters, mblowat and mcllowat need range
  * checking and pool tweaking after being reset.
  */
 static int
@@ -229,11 +260,6 @@ sysctl_kern_mbuf(SYSCTLFN_ARGS)
        node.sysctl_data = &newval;
        switch (rnode->sysctl_num) {
        case MBUF_NMBCLUSTERS:
-               if (mb_map != NULL) {
-                       node.sysctl_flags &= ~CTLFLAG_READWRITE;
-                       node.sysctl_flags |= CTLFLAG_READONLY;
-               }
-               /* FALLTHROUGH */
        case MBUF_MBLOWAT:
        case MBUF_MCLLOWAT:
                newval = *(int*)rnode->sysctl_data;
@@ -252,6 +278,8 @@ sysctl_kern_mbuf(SYSCTLFN_ARGS)
        case MBUF_NMBCLUSTERS:
                if (newval < nmbclusters)
                        return (EINVAL);
+               if (newval > nmbclusters_limit())
+                       return (EINVAL);
                nmbclusters = newval;
                pool_cache_sethardlimit(mcl_cache, nmbclusters,
                    mclpool_warnmsg, 60);
@@ -433,14 +461,14 @@ mclpool_alloc(struct pool *pp, int flags
 {
        bool waitok = (flags & PR_WAITOK) ? true : false;
 
-       return ((void *)uvm_km_alloc_poolpage(mb_map, waitok));
+       return ((void *)uvm_km_alloc_poolpage(kmem_map, waitok));
 }
 
 static void
 mclpool_release(struct pool *pp, void *v)
 {
 
-       uvm_km_free_poolpage(mb_map, (vaddr_t)v);
+       uvm_km_free_poolpage(kmem_map, (vaddr_t)v);
 }
 
 /*ARGSUSED*/
Index: sys/netipsec/keysock.c
===================================================================
RCS file: /home/joerg/repo/netbsd/src/sys/netipsec/keysock.c,v
retrieving revision 1.18
diff -u -p -r1.18 keysock.c
--- sys/netipsec/keysock.c      18 Mar 2009 16:00:23 -0000      1.18
+++ sys/netipsec/keysock.c      4 Feb 2010 19:51:26 -0000
@@ -85,7 +85,7 @@ static struct sockaddr key_src = {
 
 static int key_sendup0(struct rawcb *, struct mbuf *, int, int);
 
-int key_registered_sb_max = (NMBCLUSTERS * MHLEN); /* XXX arbitrary */
+int key_registered_sb_max = (2048 * MHLEN); /* XXX arbitrary */
 
 /* XXX sysctl */
 #ifdef __FreeBSD__
Index: sys/rump/librump/rumpkern/emul.c
===================================================================
RCS file: /home/joerg/repo/netbsd/src/sys/rump/librump/rumpkern/emul.c,v
retrieving revision 1.121
diff -u -p -r1.121 emul.c
--- sys/rump/librump/rumpkern/emul.c    31 Jan 2010 15:12:42 -0000      1.121
+++ sys/rump/librump/rumpkern/emul.c    4 Feb 2010 19:25:52 -0000
@@ -73,7 +73,6 @@ int doing_shutdown;
 const int schedppq = 1;
 int hardclock_ticks;
 bool mp_online = false;
-struct vm_map *mb_map;
 struct timeval boottime;
 struct emul emul_netbsd;
 int cold = 1;
Index: sys/uvm/uvm_extern.h
===================================================================
RCS file: /home/joerg/repo/netbsd/src/sys/uvm/uvm_extern.h,v
retrieving revision 1.161
diff -u -p -r1.161 uvm_extern.h
--- sys/uvm/uvm_extern.h        21 Nov 2009 17:45:02 -0000      1.161
+++ sys/uvm/uvm_extern.h        4 Feb 2010 19:21:25 -0000
@@ -551,7 +551,6 @@ void        uvm_reclaim_hook_del(struct uvm_rec
  */
 extern struct vm_map *kernel_map;
 extern struct vm_map *kmem_map;
-extern struct vm_map *mb_map;
 extern struct vm_map *phys_map;
 
 /*
Index: sys/uvm/uvm_fault.c
===================================================================
RCS file: /home/joerg/repo/netbsd/src/sys/uvm/uvm_fault.c,v
retrieving revision 1.161
diff -u -p -r1.161 uvm_fault.c
--- sys/uvm/uvm_fault.c 4 Feb 2010 05:48:26 -0000       1.161
+++ sys/uvm/uvm_fault.c 4 Feb 2010 20:31:46 -0000
@@ -1210,7 +1210,9 @@ uvm_fault_lower_generic(
        struct uvm_faultinfo *ufi, struct uvm_faultctx *flt,
        struct vm_page **pages)
 {
+#ifdef XXXX
        struct vm_amap *amap = ufi->entry->aref.ar_amap;
+#endif
        struct uvm_object *uobj = ufi->entry->object.uvm_obj;
        struct vm_page *uobjpage;
 
Index: sys/uvm/uvm_km.c
===================================================================
RCS file: /home/joerg/repo/netbsd/src/sys/uvm/uvm_km.c,v
retrieving revision 1.104
diff -u -p -r1.104 uvm_km.c
--- sys/uvm/uvm_km.c    7 Nov 2009 07:27:49 -0000       1.104
+++ sys/uvm/uvm_km.c    4 Feb 2010 19:25:28 -0000
@@ -91,7 +91,6 @@
  * the vm system has several standard kernel submaps, including:
  *   kmem_map => contains only wired kernel memory for the kernel
  *             malloc.
- *   mb_map => memory for large mbufs,
  *   pager_map => used to map "buf" structures into kernel space
  *   exec_map => used during exec to handle exec args
  *   etc...
Index: sys/uvm/uvm_map.c
===================================================================
RCS file: /home/joerg/repo/netbsd/src/sys/uvm/uvm_map.c,v
retrieving revision 1.286
diff -u -p -r1.286 uvm_map.c
--- sys/uvm/uvm_map.c   15 Dec 2009 06:15:11 -0000      1.286
+++ sys/uvm/uvm_map.c   4 Feb 2010 19:25:44 -0000
@@ -2332,7 +2332,7 @@ uvm_unmap_remove(struct vm_map *map, vad
                         * if the map is non-pageable, any pages mapped there
                         * must be wired and entered with pmap_kenter_pa(),
                         * and we should free any such pages immediately.
-                        * this is mostly used for kmem_map and mb_map.
+                        * this is mostly used for kmem_map.
                         */
 
                        if ((entry->flags & UVM_MAP_KMAPENT) == 0) {


Home | Main Index | Thread Index | Old Index