freebsd-dev/sys/x86
Colin Percival b7761f1f08 x86/busdma: Limit reserved pages if low nsegs
When bus_dmamap_create is called, if bouncing might be required we
reserve enough pages for a maximum-length request, subject to the
MAX_BPAGES constraint (32 MB on amd64; 32 MB or 2 MB on i386
depending on the amount of RAM).

Since pages used for bouncing are typically non-consecutive, each
bounced page will typically constitute a busdma segment; as such, we
are unlikely to ever successfully use more pages than the nsegments
limit.  Limit the number of pages reserved to nsegments.

On FreeBSD/Firecracker, this reduces bounce page memory consumption
from 32 MB to 512 kB, making VMs with 128 MB of RAM usable.

Reviewed by:	imp, mav
Sponsored by:	https://www.patreon.com/cperciva
Differential Revision:	https://reviews.freebsd.org/D37082
2022-10-21 22:47:33 -07:00
..
acpica amd64/efi: Stop falling back to hints for RSDP 2022-07-02 08:02:12 -06:00
bios x86: Remove unused devclass arguments to DRIVER_MODULE. 2022-05-06 15:46:58 -07:00
conf Retire synchronous PPP kernel driver sppp(4). 2021-10-22 11:41:36 -07:00
cpufreq cpufreq: Remove unused devclass arguments to DRIVER_MODULE. 2022-05-06 15:39:29 -07:00
include i386: check that trap() and syscall() run on the thread kstack 2022-09-14 18:46:32 +03:00
iommu kmem_malloc/free: Use void * instead of vm_offset_t for kernel pointers. 2022-09-22 15:09:19 -07:00
isa i386: check that trap() and syscall() run on the thread kstack 2022-09-14 18:46:32 +03:00
linux Adjust linux_vdso_{cpu,tsc}_selector_idx() definitions to avoid clang 15 warnings 2022-07-25 00:40:13 +02:00
pci Add NO_LEGACY_PCIB kernel option to i386, amd64 2022-10-17 23:02:22 -07:00
x86 x86/busdma: Limit reserved pages if low nsegs 2022-10-21 22:47:33 -07:00
xen PVH: Set bootmethod to PVH 2022-10-17 23:02:22 -07:00