mirror of
https://github.com/opnsense/src.git
synced 2026-03-31 06:55:18 -04:00
When we get low on memory, the VM system tries to free some by swapping pages. However, if we are so low on free pages that GELI allocations block, then the swapout operation cannot complete. This keeps the VM system from being able to free enough memory so the allocation can complete. To alleviate this, keep a UMA pool at the GELI layer which is used for data buffer allocation in the fast path, and reserve some of that memory for swap operations. If an IO operation is a swap, then use the reserved memory. If the allocation still fails, return ENOMEM instead of blocking. For non-swap allocations, change the default to using M_NOWAIT. In general, this *should* be better, since it gives upper layers a signal of the memory pressure and a chance to manage their failure strategy appropriately. However, a user can set the kern.geom.eli.blocking_malloc sysctl/tunable to restore the previous M_WAITOK strategy. Submitted by: jtl Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D24400 |
||
|---|---|---|
| .. | ||
| g_eli.c | ||
| g_eli.h | ||
| g_eli_crypto.c | ||
| g_eli_ctl.c | ||
| g_eli_hmac.c | ||
| g_eli_integrity.c | ||
| g_eli_key.c | ||
| g_eli_key_cache.c | ||
| g_eli_privacy.c | ||
| pkcs5v2.c | ||
| pkcs5v2.h | ||