Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 11 Feb 2019 09:34:23 -0800
From:      John Baldwin <jhb@FreeBSD.org>
To:        Jason Harmening <jason.harmening@gmail.com>, FreeBSD Arch <freebsd-arch@freebsd.org>
Subject:   Re: Any desire for a more flexible bus_dmamem_alloc variant ?
Message-ID:  <7d214dbe-b873-e626-776a-efdf2ac693b7@FreeBSD.org>
In-Reply-To: <ee0a8333-e5e8-0b4e-e5bd-7b1ad5410847@gmail.com>
References:  <ee0a8333-e5e8-0b4e-e5bd-7b1ad5410847@gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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

                                                                            



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?7d214dbe-b873-e626-776a-efdf2ac693b7>