Re: [PATCH 3/4] dma-debug: Dynamically expand the dma_debug_entry pool

From: Robin Murphy
Date: Tue Dec 04 2018 - 11:06:49 EST


On 04/12/2018 14:17, Christoph Hellwig wrote:
On Tue, Dec 04, 2018 at 01:11:37PM +0000, Robin Murphy wrote:
In fact, having got this far in, what I'd quite like to do is to get rid of
dma_debug_resize_entries() such that we never need to free things at all,
since then we could allocate whole pages as blocks of entries to save on
masses of individual slab allocations.

Yes, we should defintively kill dma_debug_resize_entries. Allocating
page batches might sound nice, but is that going to introduce additional
complexity?

OK, looking at what the weird AMD GART code does I reckon it should be happy enough with on-demand expansion, and that no tears will be shed if it can no longer actually trim the pool to the size it thinks is necessary. I'll add a patch to clean that up.

Page-based allocation, at least the way I'm thinking of it, shouldn't do much more than add an extra loop in one place, which should be more than made up for by removing all the freeing code :)

Robin.