The heavy write load on a nvme(4) device may exhaust the bios because of many
parallel bio requests in progress. Tmpfs(5) used by poudriere-bulk(8) is one
of such the case, in which many "swap_pager: cannot allocate bio" log lines
appear. The other filesystems can also trigger this issue, often in silence
on the log, though counted as the allocation failures of the g_bio uma(9)
zone.
This commit addresses the issue by reserving some bios for writing and alike,
allocated in the non-blocking manner. This is essentially required to make
g_new_bio() non-blocking in order to avoid the deadlock where the swap write
is needed to allocate the kernel memory for the new bios.
The default bios reserved for the non-blocking allocation is 65536. This
should be sufficient for a single nvme(4) device with the maximum parallel
requests.
- New Loader Tunable
- kern.geom.reserved_new_bios The number of the bios reserved for the non-blocking allocation. Zero means no bios are reserved. Due to the limitation on the uma(9) zone, this configuration cannot be altered upon a running host.
Signed-off-by: Seigo Tanimura <seigo.tanimura@gmail.com>