Skip to content

Commit e46406a

Browse files
Hugh Dickinsbwhacks
authored andcommitted
mm: fix the NULL mapping case in __isolate_lru_page()
commit 145e1a7 upstream. George Boole would have noticed a slight error in 4.16 commit 69d763f ("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/[email protected] Fixes: 69d763f ("mm: pin address_space before dereferencing it while isolating an LRU page") Signed-off-by: Hugh Dickins <[email protected]> Acked-by: Minchan Kim <[email protected]> Acked-by: Mel Gorman <[email protected]> Reported-by: Ivan Kalvachev <[email protected]> Cc: "Huang, Ying" <[email protected]> Cc: Jan Kara <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]> Signed-off-by: Ben Hutchings <[email protected]>
1 parent dd5fb14 commit e46406a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mm/vmscan.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1225,7 +1225,7 @@ int __isolate_lru_page(struct page *page, isolate_mode_t mode)
12251225
return ret;
12261226

12271227
mapping = page_mapping(page);
1228-
migrate_dirty = mapping && mapping->a_ops->migratepage;
1228+
migrate_dirty = !mapping || mapping->a_ops->migratepage;
12291229
unlock_page(page);
12301230
if (!migrate_dirty)
12311231
return ret;

0 commit comments

Comments
 (0)