kernel - Improve contiguous DMA memory allocation
authorMatthew Dillon <dillon@apollo.backplane.com>
Thu, 7 Dec 2017 03:09:20 +0000 (19:09 -0800)
committerMatthew Dillon <dillon@apollo.backplane.com>
Thu, 7 Dec 2017 03:09:20 +0000 (19:09 -0800)
commitdf47a6f0019ebd4d5fdeb0aa39aa217eff6097ef
tree7613e53c4e95cbc543e876af7a9364afba7fc99c
parent0047b6396c81ad5112f93e722566ef20df734ff9
kernel - Improve contiguous DMA memory allocation

* vm_page_alloc_contig() will use vm_page_alloc() for degenerate
  requests instead of the free page reserve.  This case often
  occurs when called from kmem_alloc_attr().

* vm_contig_pg_alloc() will scan the VM page queues first for
  unrestricted memory requests, falling back to vm_page_alloc_contig()
  if this fails.

  vm_contig_pg_alloc() will call vm_page_alloc_contig() first if the
  memory request has an address range restriction, falling back to
  a VM page queue scan if it fails.

* This should hopefully reduce instances where device drivers probed
  prior to e.g. NATA eat up all available low-memory DMA space,
  leaving none for NATA (or other drivers) that might need low-memory
  DMA space.
sys/vm/vm_contig.c
sys/vm/vm_kern.c
sys/vm/vm_page.c