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

From: Michal Hocko
Date: Mon Mar 29 2021 - 03:47:46 EST


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.

--
Michal Hocko
SUSE Labs