cma_alloc(), add sleep-and-retry for temporary page pinning
From: Chris Goldsworthy
Date: Wed Aug 05 2020 - 22:56:50 EST
On mobile devices, failure to allocate from a CMA area constitutes a
functional failure. Sometimes during CMA allocations, we have observed
that pages in a CMA area allocated through alloc_pages(), that we're trying
to migrate away to make room for a CMA allocation, are temporarily pinned.
This temporary pinning can occur when a process that owns the pinned page
is being forked (the example is explained further in the commit text).
This patch addresses this issue by adding a sleep-and-retry loop in
cma_alloc() . There's another example we know of similar to the above that
occurs during exit_mmap() (in zap_pte_range() specifically), but I need to
determine if this is still relevant today.