freebsd-dev/sys
Jonathan T. Looney 54503a13d8 Add a safety net to reclaim mbufs when one of the mbuf zones become
exhausted.

It is possible for a bug in the code (or, theoretically, even unusual
network conditions) to exhaust all possible mbufs or mbuf clusters.
When this occurs, things can grind to a halt fairly quickly. However,
we currently do not call mb_reclaim() unless the entire system is
experiencing a low-memory condition.

While it is best to try to prevent exhaustion of one of the mbuf zones,
it would also be useful to have a mechanism to attempt to recover from
these situations by freeing "expendable" mbufs.

This patch makes two changes:

a) The patch adds a generic API to the UMA zone allocator to set a
function that should be called when an allocation fails because the
zone limit has been reached. Because of the way this function can be
called, it really should do minimal work.

b) The patch uses this API to try to free mbufs when an allocation
fails from one of the mbuf zones because the zone limit has been
reached. The function schedules a callout to run mb_reclaim().

Differential Revision:	https://reviews.freebsd.org/D3864
Reviewed by:	gnn
Comments by:	rrs, glebius
MFC after:	2 weeks
Sponsored by:	Juniper Networks
2015-12-20 02:05:33 +00:00
..
amd64 Save the physical address passed into the kernel of the UEFI system 2015-12-19 19:01:43 +00:00
arm Add dev.fb.X.resync sysctl to resync ARM framebuffer with VideoCore 2015-12-20 00:58:22 +00:00
arm64 Support the variant of the interrupt-map property where the parent bus has 2015-12-17 17:00:04 +00:00
boot Pass the UEFI system table into the kernel from the boot loader via 2015-12-19 19:01:42 +00:00
bsm
cam Fix style issues around existing SDT probes. 2015-12-16 23:39:27 +00:00
cddl Support an arbitrary number of arguments to DTrace syscall probes. 2015-12-17 00:00:27 +00:00
compat Fix style issues around existing SDT probes. 2015-12-16 23:39:27 +00:00
conf Move some MIPS specific flags to be more congruent with other 2015-12-19 19:20:48 +00:00
contrib Add initial ar9300 HAL support for the spectral scan mode. 2015-12-02 05:36:45 +00:00
crypto
ddb Add helper to catch single step debug event and distinguish it from bkpt 2015-11-27 19:03:59 +00:00
dev Introduce a new mechanism for relocating virtual pages to a new physical 2015-12-19 18:42:50 +00:00
fs Fix breakage caused by r292373 in ZFS/FUSE/NFS/SMBFS. 2015-12-16 23:48:50 +00:00
gdb
geom It turns out that it's OK to sleep in this context, so use M_WAITOK 2015-12-18 14:10:00 +00:00
gnu Fixing a memory leak on module unloading. 2015-09-11 22:43:35 +00:00
i386 Merge common parts of i386 and amd64 md_var.h and smp.h into 2015-12-07 17:41:20 +00:00
isa
kern Add a safety net to reclaim mbufs when one of the mbuf zones become 2015-12-20 02:05:33 +00:00
kgssapi
libkern libkern: ffs, fls: s/4/3/ the 3rd BSD clause 2015-10-22 21:04:47 +00:00
mips Introduce a new mechanism for relocating virtual pages to a new physical 2015-12-19 18:42:50 +00:00
modules Scheduling module to introduce a fixed delay into the I/O path. 2015-12-18 05:39:25 +00:00
net Revert r292275 & r292379 2015-12-17 14:41:30 +00:00
net80211 net80211: remove hardcoded slot time durations from drivers 2015-12-13 20:48:24 +00:00
netgraph Create a USB_PNP_INFO and use it to export the existing PNP 2015-12-11 05:28:00 +00:00
netinet Revert r292275 & r292379 2015-12-17 14:41:30 +00:00
netinet6 Revert r292275 & r292379 2015-12-17 14:41:30 +00:00
netipsec Overhaul if_enc(4) and make it loadable in run-time. 2015-11-25 07:31:59 +00:00
netnatm
netpfil Properly drain callouts in the IPFW subsystem to avoid use after free 2015-12-15 09:02:05 +00:00
netsmb The problem report was for a crash that happened when smbfs was 2015-11-18 23:04:01 +00:00
nfs Add kernel support to the NFS server for the "-manage-gids" 2015-11-30 21:54:27 +00:00
nfsclient
nfsserver
nlm
ofed Fix i386 build WITH_OFED=YES. Remove some redundant KASSERTs. 2015-12-04 18:20:55 +00:00
opencrypto Remove unneeded includes of opt_kdtrace.h. 2015-11-22 02:01:01 +00:00
pc98 Add asynchronous command support to the pass(4) driver, and the new 2015-12-03 20:54:55 +00:00
powerpc Provide link state reporting so that ifconfig_llan0="DHCP" works. The 2015-12-19 02:16:38 +00:00
riscv/include Import RISC-V machine headers. This is a minimal set required to compile 2015-12-17 18:44:30 +00:00
rpc Improve locking of sg_threadcount. 2015-11-19 08:04:05 +00:00
security Fix style issues around existing SDT probes. 2015-12-16 23:39:27 +00:00
sparc64 Remove sv_prepsyscall, sv_sigsize and sv_sigtbl members of the struct 2015-11-28 08:49:07 +00:00
sys Save the physical address passed into the kernel of the UEFI system 2015-12-19 19:01:43 +00:00
teken
tests Style 9 changes. 2015-11-12 10:31:14 +00:00
tools Rename the /usr/share/doc/legal files to driver.LICENSE to work around 2015-10-16 00:38:05 +00:00
ufs Update ctime when atime or birthtime are updated. 2015-12-07 12:09:04 +00:00
vm Add a safety net to reclaim mbufs when one of the mbuf zones become 2015-12-20 02:05:33 +00:00
x86 x86: Detect feature flags "CLWB" and "PCOMMIT" 2015-12-19 20:47:15 +00:00
xdr
xen xen/intr: fix the event channel enabled per-cpu mask 2015-11-05 14:33:46 +00:00
Makefile