]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/commit
MFC r318353:
authorhselasky <hselasky@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Sat, 27 May 2017 08:17:59 +0000 (08:17 +0000)
committerhselasky <hselasky@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Sat, 27 May 2017 08:17:59 +0000 (08:17 +0000)
commit350d7426c42f8e33c2de90bc8d942cb0aee81c7e
tree797e96e013e6f847b6556e0d3234d43319c99314
parent97afab0a04bdbd9d425ea89b3c3e2e1eb0ca881d
MFC r318353:
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
Sponsored by: Mellanox Technologies

git-svn-id: svn://svn.freebsd.org/base/stable/10@318977 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
sys/arm/arm/busdma_machdep-v6.c
sys/arm/arm/busdma_machdep.c
sys/x86/x86/busdma_bounce.c