Any desire for a more flexible bus_dmamem_alloc variant ?

Jason Harmening jason.harmening at gmail.com
Sun Feb 10 09:15:48 UTC 2019


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?

--Jason



More information about the freebsd-arch mailing list