29c29
< __FBSDID("$FreeBSD: head/sys/kern/kern_mbuf.c 243631 2012-11-27 21:19:58Z andre $");
---
> __FBSDID("$FreeBSD: head/sys/kern/kern_mbuf.c 243639 2012-11-27 23:16:56Z andre $");
109a110,111
> *
> * NB: This has to be done before VM init.
115d116
< /* This has to be done before VM init. */
117,127c118,119
< if (nmbclusters == 0) {
< #ifdef VM_AUTOTUNE_NMBCLUSTERS
< nmbclusters = VM_AUTOTUNE_NMBCLUSTERS;
< #else
< nmbclusters = 1024 + maxusers * 64;
< #endif
< #ifdef VM_MAX_AUTOTUNE_NMBCLUSTERS
< if (nmbclusters > VM_MAX_AUTOTUNE_NMBCLUSTERS)
< nmbclusters = VM_MAX_AUTOTUNE_NMBCLUSTERS;
< #endif
< }
---
> if (nmbclusters == 0)
> nmbclusters = maxmbufmem / MCLBYTES / 4;
131c123
< nmbjumbop = nmbclusters / 2;
---
> nmbjumbop = maxmbufmem / MJUMPAGESIZE / 4;
135c127
< nmbjumbo9 = nmbclusters / 4;
---
> nmbjumbo9 = maxmbufmem / MJUM9BYTES / 6;
139c131,141
< nmbjumbo16 = nmbclusters / 8;
---
> nmbjumbo16 = maxmbufmem / MJUM16BYTES / 6;
>
> /*
> * We need at least as many mbufs as we have clusters of
> * the various types added together.
> */
> TUNABLE_INT_FETCH("kern.ipc.nmbufs", &nmbufs);
> if (nmbufs < nmbclusters + nmbjumbop + nmbjumbo9 + nmbjumbo16)
> nmbufs = lmax(maxmbufmem / MSIZE / 5,
> nmbclusters + nmbjumbop + nmbjumbo9 + nmbjumbo16);
>
244c246
< nmbclusters = uma_zone_get_max(zone_mbuf);
---
> nmbufs = uma_zone_get_max(zone_mbuf);
< __FBSDID("$FreeBSD: head/sys/kern/kern_mbuf.c 243631 2012-11-27 21:19:58Z andre $");
---
> __FBSDID("$FreeBSD: head/sys/kern/kern_mbuf.c 243639 2012-11-27 23:16:56Z andre $");
109a110,111
> *
> * NB: This has to be done before VM init.
115d116
< /* This has to be done before VM init. */
117,127c118,119
< if (nmbclusters == 0) {
< #ifdef VM_AUTOTUNE_NMBCLUSTERS
< nmbclusters = VM_AUTOTUNE_NMBCLUSTERS;
< #else
< nmbclusters = 1024 + maxusers * 64;
< #endif
< #ifdef VM_MAX_AUTOTUNE_NMBCLUSTERS
< if (nmbclusters > VM_MAX_AUTOTUNE_NMBCLUSTERS)
< nmbclusters = VM_MAX_AUTOTUNE_NMBCLUSTERS;
< #endif
< }
---
> if (nmbclusters == 0)
> nmbclusters = maxmbufmem / MCLBYTES / 4;
131c123
< nmbjumbop = nmbclusters / 2;
---
> nmbjumbop = maxmbufmem / MJUMPAGESIZE / 4;
135c127
< nmbjumbo9 = nmbclusters / 4;
---
> nmbjumbo9 = maxmbufmem / MJUM9BYTES / 6;
139c131,141
< nmbjumbo16 = nmbclusters / 8;
---
> nmbjumbo16 = maxmbufmem / MJUM16BYTES / 6;
>
> /*
> * We need at least as many mbufs as we have clusters of
> * the various types added together.
> */
> TUNABLE_INT_FETCH("kern.ipc.nmbufs", &nmbufs);
> if (nmbufs < nmbclusters + nmbjumbop + nmbjumbo9 + nmbjumbo16)
> nmbufs = lmax(maxmbufmem / MSIZE / 5,
> nmbclusters + nmbjumbop + nmbjumbo9 + nmbjumbo16);
>
244c246
< nmbclusters = uma_zone_get_max(zone_mbuf);
---
> nmbufs = uma_zone_get_max(zone_mbuf);