freebsd-skq/sys
adrian 73868b5389 Also make kern.maxfilesperproc a boot time tunable.
Auto-tuning threshold discussions aside, it turns out that if you want
to lower this on say, rather memory-packed machines, you either set maxusers
or kern.maxfiles, or you set it in sysctl.  The former is a non-exact
way to tune this; the latter doesn't actually affect anything in the
startup scripts.

This first occured because I wondered why the hell screen would take upwards
of 10 seconds to spawn a new screen.  I then found python doing the same
thing during fork/exec of child processes - it calls close() on each FD
up to the current openfiles limit.  On a 1TB machine this is like, 26 million
FDs per process.  Ugh.

So:

* This allows it to be set early in /boot/loader.conf;
* It can be used to work around the ridiculous situation of
  screen, python, etc doing a close() on potentially millions of FDs
  even though you only have four open.

Tested:

* 4GB, 32GB, 64GB, 128GB, 384GB, 1TB systems with autotune, ensuring
  screen and python forking doesn't result in some pretty hilariously
  bad behaviour.

TODO:

* Note that the default login.conf sets openfiles-cur to unlimited,
  effectively obeying kern.maxfilesperproc.  Perhaps we should fix
  this.

* .. and even if we do, we need to also ensure that daemons get
  a soft limit of something reasonable and capped - they can request
  more FDs themselves.

MFC after:	1 week
Sponsored by:	Norse Corp, Inc.
2015-09-10 04:05:58 +00:00
..
amd64 Remove an unneeded instruction. 2015-08-28 00:17:21 +00:00
arm Clean up the style of the LEAVE_HYP macro. 2015-08-31 09:39:16 +00:00
arm64 Rework copyinstr to: 2015-09-09 11:51:14 +00:00
boot As expected, things aren't as simple as hoped. Consequently, we have 2015-09-07 17:56:49 +00:00
bsm
cam Allow LUN options modification via CTL_LUNREQ_MODIFY. 2015-09-06 11:23:01 +00:00
cddl Expose an interface to determine if an ACE is inherited. 2015-09-04 00:14:20 +00:00
compat Fixes a panic triggered by threaded Linux applications when running 2015-09-02 14:04:13 +00:00
conf Remove opt_random.h header pollution from sys/random.h by moving 2015-09-08 08:50:28 +00:00
contrib Fix compilation error on gcc-5.2.0 - it now warns on non-paranthen'ed 2015-08-30 08:46:50 +00:00
crypto const'ify an arg that we don't update... 2015-07-29 23:37:15 +00:00
ddb Make kstack_pages a tunable on arm, x86, and powepc. On i386, the 2015-08-10 17:18:21 +00:00
dev Add new USB ID. 2015-09-09 07:04:00 +00:00
fs Fix an NFS server bug that manifested in "ls -al" displaying a plus 2015-08-28 14:26:11 +00:00
gdb CALLOUT_MPSAFE has lost its meaning since r141428, i.e., for more than ten 2015-05-22 17:05:21 +00:00
geom After the introduction of direct dispatch, the pacing code in g_down() 2015-09-02 17:29:30 +00:00
gnu Using consistent coding style to deal with error inside the loop. 2015-08-18 13:16:23 +00:00
i386 preload_search_info: make sure mod is set 2015-08-21 15:57:57 +00:00
isa
kern Also make kern.maxfilesperproc a boot time tunable. 2015-09-10 04:05:58 +00:00
kgssapi
libkern Remove checks for __ARM_EABI__, we only build for EABI now. 2015-07-09 21:02:40 +00:00
mips Remove rge driver from Broadcom XLR 2015-09-04 19:57:28 +00:00
modules Revert r286984 (adding opt_random.h to sys/modules/zfs/Makefile) 2015-09-08 08:54:40 +00:00
net Constantify lookup key in ifa_ifwith* functions. 2015-09-05 05:33:20 +00:00
net80211 Replay r286410. Change KPI of how device drivers that provide wireless 2015-08-27 08:56:39 +00:00
netgraph * Address review (and add a bit myself). 2015-07-12 18:14:38 +00:00
netinet RFC 4960 requires that packets containing an INIT chunk bundled with 2015-09-07 14:00:38 +00:00
netinet6 Add support for receiving flowtype, flowid and RSS bucket information as part of recvmsg(). 2015-09-06 20:57:57 +00:00
netipsec Make IPsec work with AES-GCM and AES-ICM (aka CTR) in OCF... IPsec 2015-08-04 17:47:11 +00:00
netnatm
netpfil pf: Fix misdetection of forwarding when net.link.bridge.pfil_bridge is set 2015-09-01 19:04:04 +00:00
netsmb
nfs
nfsclient
nfsserver
nlm
ofed Currently the Linux character device mmap handling only supports mmap 2015-09-03 18:27:39 +00:00
opencrypto Make IPsec work with AES-GCM and AES-ICM (aka CTR) in OCF... IPsec 2015-08-04 17:47:11 +00:00
pc98 Add missing ofw_machdep.h. Make x86 ofw_machdep.h work pc98 too. 2015-08-28 15:41:09 +00:00
powerpc Add PVR identifier for E6500, from the reference. 2015-09-09 03:15:25 +00:00
rpc Set curvnet context inside the RPC code in more places. 2015-08-18 18:12:46 +00:00
security fd: make 'rights' a manadatory argument to fget* functions 2015-07-05 19:05:16 +00:00
sparc64 Rationalize BSD license on sys/*/include/in_cksum.h 2015-08-05 19:05:12 +00:00
sys Remove opt_random.h header pollution from sys/random.h by moving 2015-09-08 08:50:28 +00:00
teken Sync HPA and VPA implementations with CUP. 2015-08-24 07:49:27 +00:00
tools
ufs Do not consume extra reference. This is a bug in r287479. 2015-09-05 12:28:18 +00:00
vm Remove a check which caused spurious SIGSEGV on usermode access to the 2015-09-09 06:19:33 +00:00
x86 Add missing ofw_machdep.h. Make x86 ofw_machdep.h work pc98 too. 2015-08-28 15:41:09 +00:00
xdr
xen xen: allow disabling PV disks and nics 2015-08-21 15:53:08 +00:00
Makefile Kill EoL whitespace. 2015-05-29 14:03:07 +00:00