mm: fix the NULL mapping case in __isolate_lru_page()
authorHugh Dickins <hughd@google.com>
Fri, 1 Jun 2018 23:50:50 +0000 (16:50 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 2 Jun 2018 16:33:47 +0000 (09:33 -0700)
commit145e1a71e090575c74969e3daa8136d1e5b99fc8
treec17c5356ad4f266fd806bd7808a5b3435433c7f1
parent2d077d4b59924acd1f5180c6fb73b57f4771fde6
mm: fix the NULL mapping case in __isolate_lru_page()

George Boole would have noticed a slight error in 4.16 commit
69d763fc6d3a ("mm: pin address_space before dereferencing it while
isolating an LRU page").  Fix it, to match both the comment above it,
and the original behaviour.

Although anonymous pages are not marked PageDirty at first, we have an
old habit of calling SetPageDirty when a page is removed from swap
cache: so there's a category of ex-swap pages that are easily
migratable, but were inadvertently excluded from compaction's async
migration in 4.16.

Link: http://lkml.kernel.org/r/alpine.LSU.2.11.1805302014001.12558@eggly.anvils
Fixes: 69d763fc6d3a ("mm: pin address_space before dereferencing it while isolating an LRU page")
Signed-off-by: Hugh Dickins <hughd@google.com>
Acked-by: Minchan Kim <minchan@kernel.org>
Acked-by: Mel Gorman <mgorman@techsingularity.net>
Reported-by: Ivan Kalvachev <ikalvachev@gmail.com>
Cc: "Huang, Ying" <ying.huang@intel.com>
Cc: Jan Kara <jack@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/vmscan.c