1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-21 11:13:30 +00:00
freebsd/sys
Konstantin Belousov 76386c7ecd Rework the test which raises OOM condition. Right now, the code
checks for the swap space consumption plus checks that the amount of
the free pages exceeds some limit, in case pagedeamon did not coped
with the page shortage in one of the late passes.  This is wrong
because it does not account for the presence of the reclamaible pages
in the queues which are not selectable for reclaim immediately.  E.g.,
on the swap-less systems, large active queue easily triggered OOM.

Instead, only raise OOM when pagedaemon is unable to produce a free
page in several back-to-back passes.  Track the failed passes per
pagedaemon thread.

The number of passes to trigger OOM was selected empirically and
tested both on small (32M-64M i386 VM) and large (32G amd64)
configurations.  If the specifics of the load require tuning, sysctl
vm.pageout_oom_seq sets the number of back-to-back passes which must
fail before OOM is raised.  Each pass takes 1/2 of seconds.  Less the
value, more sensible the pagedaemon is to the page shortage.

In future, some heuristic to calculate the value of the tunable might
be designed based on the system configuration and load.  But before it
can be done, the i/o system must be fixed to reliably time-out
pagedaemon writes, even if waiting for the memory to proceed.  Then,
code can account for the in-flight page-outs and postpone OOM until
all of them finished, which should reduce the need in tuning.  Right
now, ignoring the in-flight writes and the counter allows to break
deadlocks due to write path doing sleepable memory allocations.

Reported by:	Dmitry Sivachenko, bde, many others
Tested by:	pho, bde, tuexen (arm)
Reviewed by:	alc
Discussed with:	bde, imp
Sponsored by:	The FreeBSD Foundation
MFC after:	3 weeks
2015-11-16 06:26:26 +00:00
..
amd64 Export various helper variables describing the layout and size of 2015-11-12 22:00:59 +00:00
arm Replace magic numbers for CCGRx registers with more descriptive names 2015-11-14 22:46:50 +00:00
arm64 Fix typo in message from arm64 ITS workaround 2015-11-09 01:49:25 +00:00
boot Add support for the Zybo and similar boards to ZEDBOARD kernel. 2015-11-13 15:36:40 +00:00
bsm
cam Add NULL check to make Coverity happy. 2015-11-14 14:56:01 +00:00
cddl Switch zfs_panic_recover to panic for bad DVA 2015-11-06 20:45:19 +00:00
compat Add assert and note about the size of "unsigned long" inside the 2015-11-13 09:00:39 +00:00
conf Now that the PMU implementation is independent of HWPMC 2015-11-09 17:57:32 +00:00
contrib Fix slots DMA memory handling. It's similar to r290553. 2015-11-10 10:56:52 +00:00
crypto
ddb
dev Increase reset assertion time from 10 to 100us. 2015-11-15 10:58:01 +00:00
fs - Consistently use PROC_ASSERT_HELD() to verify that a process' hold count 2015-11-08 01:38:56 +00:00
gdb
geom Fix g_eli error loss conditions 2015-11-05 17:37:35 +00:00
gnu
i386 Export various helper variables describing the layout and size of 2015-11-12 22:00:59 +00:00
isa
kern Speed up rctl operation with large rulesets, by holding the lock 2015-11-15 12:10:51 +00:00
kgssapi
libkern
mips Add QCA9533 to the list of SoCs that require IRQ's be ACKed. 2015-11-16 06:15:01 +00:00
modules Add riotboard DTB to dtb/imx6 2015-11-12 03:37:28 +00:00
net Pass provided af instead of AF_UNSPEC to setwa_f callback. 2015-11-14 18:16:17 +00:00
net80211 net80211: add ieee80211_restart_all() call. 2015-10-27 20:40:57 +00:00
netgraph Move iflladdr_event eventhandler invocation to if_setlladdr. 2015-11-14 13:34:03 +00:00
netinet Revert r290403 2015-11-13 23:14:39 +00:00
netinet6 Bring back the ability of passing cached route via nd6_output_ifp(). 2015-11-15 16:02:22 +00:00
netipsec Turning on IPSEC used to introduce a slight amount of performance 2015-10-27 00:42:15 +00:00
netnatm
netpfil Bring back the ability of passing cached route via nd6_output_ifp(). 2015-11-15 16:02:22 +00:00
netsmb
nfs
nfsclient
nfsserver
nlm
ofed Fix integer to pointer of different size conversion warnings when 2015-11-12 10:12:20 +00:00
opencrypto
pc98
powerpc Write 2- and 4-byte aligned values as single writes in ddb(4) 2015-11-06 04:56:52 +00:00
rpc
security
sparc64 Fix an alignment check that is wrong in half the busdma implementations. 2015-11-02 23:37:19 +00:00
sys Doh, commit in a wrong directory. Fix r290857. 2015-11-15 12:50:14 +00:00
teken
tests Style 9 changes. 2015-11-12 10:31:14 +00:00
tools
ufs Do not perform read-ahead for BA_CLRBUF request when we are low on 2015-10-27 13:44:13 +00:00
vm Rework the test which raises OOM condition. Right now, the code 2015-11-16 06:26:26 +00:00
x86 x86/dma_bounce: rework _bus_dmamap_load_ma implementation 2015-11-09 12:19:58 +00:00
xdr
xen xen/intr: fix the event channel enabled per-cpu mask 2015-11-05 14:33:46 +00:00
Makefile