Revision 64165b1affc5bc16231ac971e66aae7d68d57f2c authored by Hugh Dickins on 19 April 2019, 00:50:09 UTC, committed by Linus Torvalds on 19 April 2019, 16:46:04 UTC
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.

Link: http://lkml.kernel.org/r/alpine.LSU.2.11.1904081258200.1523@eggly.anvils
Fixes: b56a2d8af914 ("mm: rid swapoff of quadratic complexity")
Signed-off-by: Hugh Dickins <hughd@google.com>
Cc: "Alex Xu (Hello71)" <alex_y_xu@yahoo.ca>
Cc: Huang Ying <ying.huang@intel.com>
Cc: Kelley Nielsen <kelleynnn@gmail.com>
Cc: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
Cc: Rik van Riel <riel@surriel.com>
Cc: Vineeth Pillai <vpillai@digitalocean.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent dd862de
History
File Mode Size
Kconfig -rw-r--r-- 2.8 KB
Makefile -rw-r--r-- 484 bytes
auth.c -rw-r--r-- 12.2 KB
budget.c -rw-r--r-- 23.9 KB
commit.c -rw-r--r-- 20.5 KB
compress.c -rw-r--r-- 6.7 KB
crypto.c -rw-r--r-- 2.3 KB
debug.c -rw-r--r-- 84.1 KB
debug.h -rw-r--r-- 12.5 KB
dir.c -rw-r--r-- 42.9 KB
file.c -rw-r--r-- 47.2 KB
find.c -rw-r--r-- 30.1 KB
gc.c -rw-r--r-- 28.7 KB
io.c -rw-r--r-- 35.7 KB
ioctl.c -rw-r--r-- 6.1 KB
journal.c -rw-r--r-- 51.3 KB
key.h -rw-r--r-- 14.9 KB
log.c -rw-r--r-- 19.9 KB
lprops.c -rw-r--r-- 36.0 KB
lpt.c -rw-r--r-- 62.4 KB
lpt_commit.c -rw-r--r-- 51.2 KB
master.c -rw-r--r-- 11.7 KB
misc.c -rw-r--r-- 1.3 KB
misc.h -rw-r--r-- 8.1 KB
orphan.c -rw-r--r-- 24.7 KB
recovery.c -rw-r--r-- 43.6 KB
replay.c -rw-r--r-- 34.5 KB
sb.c -rw-r--r-- 26.7 KB
scan.c -rw-r--r-- 9.5 KB
shrinker.c -rw-r--r-- 9.6 KB
super.c -rw-r--r-- 62.9 KB
tnc.c -rw-r--r-- 92.1 KB
tnc_commit.c -rw-r--r-- 27.6 KB
tnc_misc.c -rw-r--r-- 13.3 KB
ubifs-media.h -rw-r--r-- 24.6 KB
ubifs.h -rw-r--r-- 71.1 KB
xattr.c -rw-r--r-- 18.2 KB

back to top