freebsd-dev/sys/x86
Hans Petter Selasky 65b017b420 Avoid use of contiguous memory allocations in busdma when possible.
This patch improves the boundary checks in busdma to allow more cases
using the regular page based kernel memory allocator. Especially in
the case of having a non-zero boundary in the parent DMA tag. For
example AMD64 based platforms set the PCI DMA tag boundary to
PCI_DMA_BOUNDARY, 4GB, which before this patch caused contiguous
memory allocations to be preferred when allocating more than PAGE_SIZE
bytes. Even if the required alignment was less than PAGE_SIZE bytes.

This patch also fixes the nsegments check for using kmem_alloc_attr()
when the maximum segment size is less than PAGE_SIZE bytes.

Updated some comments describing the code in question.

Differential Revision:	https://reviews.freebsd.org/D10645
Reviewed by:		kib, jhb, gallatin, scottl
MFC after:		1 week
Sponsored by:		Mellanox Technologies
2017-05-16 14:21:37 +00:00
..
acpica Ensure that resume path on amd64 only accesses page tables for normal 2017-05-15 20:52:43 +00:00
bios
cpufreq - Mention mismatching numbers in MSR vs. ACPI _PSS count warning: seeing 2016-12-01 14:31:05 +00:00
include Remove the LSOL26CALLS_SEL constant. 2017-04-25 23:19:27 +00:00
iommu Correct calculation of the entry->free_down in the invariants-checking 2017-04-14 15:16:41 +00:00
isa Validate values read from the RTC before trying BCD decoding 2017-03-09 02:19:30 +00:00
pci Convert PCIe Hot Plug to using pci_request_feature 2017-02-25 06:11:59 +00:00
x86 Avoid use of contiguous memory allocations in busdma when possible. 2017-05-16 14:21:37 +00:00
xen All these files need sys/vmmeter.h, but now they got it implicitly 2017-04-17 17:07:00 +00:00