On Mon, Aug 29, 2022 at 05:09:25PM +1000, Alistair Popple wrote: > So how about the following: > > /* > * We rely on trylock_page() to avoid deadlock between > * concurrent migrations where each is waiting on the others > * page lock. If we can't immediately lock the page we fail this > * migration as it is only best effort anyway. > * > * If we can lock the page it's safe to set up a migration entry > * now. In the common case where the page is mapped once in a > * single process setting up the migration entry now is an > * optimisation to avoid walking the rmap later with > * try_to_migrate(). > */ Good to me, thanks. -- Peter Xu