mm: swapoff: take notice of completion sooner
The old try_to_unuse() implementation was driven by find_next_to_unuse(),
which terminated as soon as all the swap had been freed.
Add inuse_pages checks now (alongside signal_pending()) to stop scanning
mms and swap_map once finished.
The same ought to be done in shmem_unuse() too, but never was before,
and needs a different interface: so leave it as is for now.
Fixes: b56a2d8af914 ("mm: rid swapoff of quadratic complexity")
Signed-off-by: Hugh Dickins <email@example.com>
Cc: "Alex Xu (Hello71)" <firstname.lastname@example.org>
Cc: Huang Ying <email@example.com>
Cc: Kelley Nielsen <firstname.lastname@example.org>
Cc: Konstantin Khlebnikov <email@example.com>
Cc: Rik van Riel <firstname.lastname@example.org>
Cc: Vineeth Pillai <email@example.com>
Signed-off-by: Andrew Morton <firstname.lastname@example.org>
Signed-off-by: Linus Torvalds <email@example.com>
1 file changed