Re: [RFC 4/4] dma-debug: Make leak-like behaviour apparent

From: Christoph Hellwig
Date: Tue Dec 04 2018 - 09:31:09 EST


On Mon, Dec 03, 2018 at 05:28:09PM +0000, Robin Murphy wrote:
> Now that we can dynamically allocate DMA debug entries to cope with
> drivers maintaining excessively large numbers of live mappings, a driver
> which *does* actually have a bug leaking mappings (and is not unloaded)
> will no longer trigger the "DMA-API: debugging out of memory - disabling"
> message until it gets to actual kernel OOM conditions, which means it
> could go unnoticed for a while. To that end, let's inform the user each
> time the pool has grown to a multiple of its initial size, which should
> make it apparent that they either have a leak or might want to increase
> the preallocation size.
>
> Signed-off-by: Robin Murphy <robin.murphy@xxxxxxx>
> ---
>
> Tagging this one as RFC since people might think it's silly.

I think finding out the numbers is useful, but I'm a little worried
about claiming a possible leak. Maybe we just need to print a log message
for each new power of 2 of entries reached?