diff options
author | Hugh Dickins | 2014-12-03 00:59:39 +0100 |
---|---|---|
committer | Linus Torvalds | 2014-12-03 18:36:03 +0100 |
commit | 2022b4d18a491a578218ce7a4eca8666db895a73 (patch) | |
tree | e18b23dd07cd0a361143556e184262e992d2b4c9 /mm/rmap.c | |
parent | fat: fix oops on corrupted vfat fs (diff) | |
download | kernel-qcow2-linux-2022b4d18a491a578218ce7a4eca8666db895a73.tar.gz kernel-qcow2-linux-2022b4d18a491a578218ce7a4eca8666db895a73.tar.xz kernel-qcow2-linux-2022b4d18a491a578218ce7a4eca8666db895a73.zip |
mm: fix swapoff hang after page migration and fork
I've been seeing swapoff hangs in recent testing: it's cycling around
trying unsuccessfully to find an mm for some remaining pages of swap.
I have been exercising swap and page migration more heavily recently,
and now notice a long-standing error in copy_one_pte(): it's trying to
add dst_mm to swapoff's mmlist when it finds a swap entry, but is doing
so even when it's a migration entry or an hwpoison entry.
Which wouldn't matter much, except it adds dst_mm next to src_mm,
assuming src_mm is already on the mmlist: which may not be so. Then if
pages are later swapped out from dst_mm, swapoff won't be able to find
where to replace them.
There's already a !non_swap_entry() test for stats: move that up before
the swap_duplicate() and the addition to mmlist.
Signed-off-by: Hugh Dickins <hughd@google.com>
Cc: Kelley Nielsen <kelleynnn@gmail.com>
Cc: <stable@vger.kernel.org> [2.6.18+]
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/rmap.c')
0 files changed, 0 insertions, 0 deletions