Re: [PATCH 1/8] mm: cma: introduce cma_release_nowait()

From: Mike Kravetz
Date: Mon Mar 29 2021 - 18:34:59 EST


On 3/29/21 12:46 AM, Michal Hocko wrote:
> On Fri 26-03-21 14:32:01, Mike Kravetz wrote:
> [...]
>> - Just change the mutex to an irq safe spinlock.
>
> Yes please.
>
>> AFAICT, the potential
>> downsides could be:
>> - Interrupts disabled during long bitmap scans
>
> How large those bitmaps are in practice?
>
>> - Wasted cpu cycles (spinning) if there is much contention on lock
>> Both of these would be more of an issue on small/embedded systems. I
>> took a quick look at the callers of cma_alloc/cma_release and nothing
>> stood out that could lead to high degrees of contention. However, I
>> could have missed something.
>
> If this is really a practical concern then we can try a more complex
> solution based on some data.
>

Ok, I will send v2 with this approach. Adding Barry and Will on Cc: as
they were involved in adding more cma use cases for dma on arm.

--
Mike Kravetz