Skip to content

Commit 88dbcbb

Browse files
jankaratorvalds
authored andcommitted
blkdev: avoid migration stalls for blkdev pages
Currently, block device pages don't provide a ->migratepage callback and thus fallback_migrate_page() is used for them. This handler cannot deal with dirty pages in async mode and also with the case a buffer head is in the LRU buffer head cache (as it has elevated b_count). Thus such page can block memory offlining. Fix the problem by using buffer_migrate_page_norefs() for migrating block device pages. That function takes care of dropping bh LRU in case migration would fail due to elevated buffer refcount to avoid stalls and can also migrate dirty pages without writing them. Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Jan Kara <[email protected]> Acked-by: Mel Gorman <[email protected]> Cc: Michal Hocko <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 89cb088 commit 88dbcbb

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

fs/block_dev.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1966,6 +1966,7 @@ static const struct address_space_operations def_blk_aops = {
19661966
.writepages = blkdev_writepages,
19671967
.releasepage = blkdev_releasepage,
19681968
.direct_IO = blkdev_direct_IO,
1969+
.migratepage = buffer_migrate_page_norefs,
19691970
.is_dirty_writeback = buffer_check_dirty_writeback,
19701971
};
19711972

0 commit comments

Comments
 (0)