38c38
< __FBSDID("$FreeBSD: head/sys/kern/subr_param.c 242847 2012-11-10 02:08:40Z alfred $");
---
> __FBSDID("$FreeBSD: head/sys/kern/subr_param.c 243631 2012-11-27 21:19:58Z andre $");
95a96
> long maxmbufmem; /* max mbuf memory */
272a274
> long realmem;
296,299d297
< */
< maxproc = NPROC;
< TUNABLE_INT_FETCH("kern.maxproc", &maxproc);
< /*
302a301,302
> maxproc = NPROC;
> TUNABLE_INT_FETCH("kern.maxproc", &maxproc);
305,306d304
< maxfiles = MAXFILES;
< TUNABLE_INT_FETCH("kern.maxfiles", &maxfiles);
308c306,316
< maxfilesperproc = (maxfiles * 9) / 10;
---
>
> /*
> * The default limit for maxfiles is 1/12 of the number of
> * physical page but not less than 16 times maxusers.
> * At most it can be 1/6 the number of physical pages.
> */
> maxfiles = imax(MAXFILES, physpages / 8);
> TUNABLE_INT_FETCH("kern.maxfiles", &maxfiles);
> if (maxfiles > (physpages / 4))
> maxfiles = physpages / 4;
> maxfilesperproc = (maxfiles / 10) * 9;
315a324,326
> /*
> * XXX: Does the callout wheel have to be so big?
> */
319a331,342
> * The default limit for all mbuf related memory is 1/2 of all
> * available kernel memory (physical or kmem).
> * At most it can be 3/4 of available kernel memory.
> */
> realmem = lmin(physpages * PAGE_SIZE,
> VM_MAX_KERNEL_ADDRESS - VM_MIN_KERNEL_ADDRESS);
> maxmbufmem = realmem / 2;
> TUNABLE_LONG_FETCH("kern.maxmbufmem", &maxmbufmem);
> if (maxmbufmem > (realmem / 4) * 3)
> maxmbufmem = (realmem / 4) * 3;
>
> /*
323a347
> TUNABLE_LONG_FETCH("kern.ipc.maxpipekva", &maxpipekva);
329d352
< TUNABLE_LONG_FETCH("kern.ipc.maxpipekva", &maxpipekva);
< __FBSDID("$FreeBSD: head/sys/kern/subr_param.c 242847 2012-11-10 02:08:40Z alfred $");
---
> __FBSDID("$FreeBSD: head/sys/kern/subr_param.c 243631 2012-11-27 21:19:58Z andre $");
95a96
> long maxmbufmem; /* max mbuf memory */
272a274
> long realmem;
296,299d297
< */
< maxproc = NPROC;
< TUNABLE_INT_FETCH("kern.maxproc", &maxproc);
< /*
302a301,302
> maxproc = NPROC;
> TUNABLE_INT_FETCH("kern.maxproc", &maxproc);
305,306d304
< maxfiles = MAXFILES;
< TUNABLE_INT_FETCH("kern.maxfiles", &maxfiles);
308c306,316
< maxfilesperproc = (maxfiles * 9) / 10;
---
>
> /*
> * The default limit for maxfiles is 1/12 of the number of
> * physical page but not less than 16 times maxusers.
> * At most it can be 1/6 the number of physical pages.
> */
> maxfiles = imax(MAXFILES, physpages / 8);
> TUNABLE_INT_FETCH("kern.maxfiles", &maxfiles);
> if (maxfiles > (physpages / 4))
> maxfiles = physpages / 4;
> maxfilesperproc = (maxfiles / 10) * 9;
315a324,326
> /*
> * XXX: Does the callout wheel have to be so big?
> */
319a331,342
> * The default limit for all mbuf related memory is 1/2 of all
> * available kernel memory (physical or kmem).
> * At most it can be 3/4 of available kernel memory.
> */
> realmem = lmin(physpages * PAGE_SIZE,
> VM_MAX_KERNEL_ADDRESS - VM_MIN_KERNEL_ADDRESS);
> maxmbufmem = realmem / 2;
> TUNABLE_LONG_FETCH("kern.maxmbufmem", &maxmbufmem);
> if (maxmbufmem > (realmem / 4) * 3)
> maxmbufmem = (realmem / 4) * 3;
>
> /*
323a347
> TUNABLE_LONG_FETCH("kern.ipc.maxpipekva", &maxpipekva);
329d352
< TUNABLE_LONG_FETCH("kern.ipc.maxpipekva", &maxpipekva);