Any desire for a more flexible bus_dmamem_alloc variant ?

John Baldwin jhb at FreeBSD.org
Mon Feb 11 17:34:26 UTC 2019


On 2/10/19 1:13 AM, Jason Harmening wrote:
> Hi everyone,
> 
> It's really bugged me for years that bus_dmamem_alloc() just uses the 
> tag's maximum size instead of allowing a size to be passed in.  I got 
> reminded of this again recently when looking over some busdma code.
> 
> I know others have voiced this complaint in the past: 
> https://lists.freebsd.org/pipermail/freebsd-current/2012-July/035281.html
> 
> I used to work on an out-of-tree driver that could've benefited from 
> something like this.  It also seems like the benefits of using 
> bus_dmamem_alloc() to always do the optimal thing instead of, say, 
> rolling your own using kmem_alloc_[attr|contig] will increase as we 
> adopt support for IOMMUs.
> 
> I'd like to see if there's any interest in adding a 
> bus_dmamem_alloc_attr() KPI that takes both a size and vm_memattr_t. 
> Are there any potential in-tree consumers of such a thing?

I have this review I need to rebase and write the manpage bits for.  While
it still ties the the size to the tag, it mostly hides the individual tag:

https://reviews.freebsd.org/D5704

-- 
John Baldwin

                                                                            


More information about the freebsd-arch mailing list