[PATCH v6 06/24] dma-heap: Add proper kref handling on dma-buf heaps

Markus Elfring Markus.Elfring at web.de
Tue Jun 18 07:22:03 UTC 2024


> Add proper refcounting on the dma_heap structure.

             reference counting?


> While existing heaps are built-in, we may eventually
> have heaps loaded from modules, and we'll need to be
> able to properly handle the references to the heaps

You may occasionally put more than 52 characters into text lines
of such a change description.


…
> +++ b/drivers/dma-buf/dma-heap.c
…
> +static void dma_heap_release(struct kref *ref)
> +{
…
> +	mutex_lock(&heap_list_lock);
> +	list_del(&heap->list);
> +	mutex_unlock(&heap_list_lock);
…

Would you become interested to apply a statement like “guard(mutex)(&heap_list_lock);”?
https://elixir.bootlin.com/linux/v6.10-rc4/source/include/linux/mutex.h#L196

Regards,
Markus


More information about the dri-devel mailing list