mm: avoid deadlock due to follow_page/cma migration serialization

[1] introduced a lock to serialize follow_page with cma serialization
to prevent CMA allocation failures due to mutliple refcounts on the

This holds the global lock when potentially faulting in pages.
If these pages come from a FUSE filesystem, __get_user_pages will
be called again and deadlock.

Also, the "skip stack guard page" path exited without releasing
the lock.

Only hold the lock while following the page or while doing migration,
and release the lock when faulting pages in.

[1] f269714 mm: cma: migrate cma pages during __get_user_pages

Bug: 25168959

Change-Id: I89cb69aa7c7ed708bc032b94cf20e2ec8a404f30
1 file changed