The patch titled Subject: blkdev: avoid migration stalls for blkdev pages has been added to the -mm tree. Its filename is blkdev-avoid-migration-stalls-for-blkdev-pages.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/blkdev-avoid-migration-stalls-for-blkdev-pages.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/blkdev-avoid-migration-stalls-for-blkdev-pages.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Jan Kara <jack@xxxxxxx> Subject: 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/20181211172143.7358-6-jack@xxxxxxx Signed-off-by: Jan Kara <jack@xxxxxxx> Acked-by: Mel Gorman <mgorman@xxxxxxx> Cc: Michal Hocko <mhocko@xxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- --- a/fs/block_dev.c~blkdev-avoid-migration-stalls-for-blkdev-pages +++ a/fs/block_dev.c @@ -1966,6 +1966,7 @@ static const struct address_space_operat .writepages = blkdev_writepages, .releasepage = blkdev_releasepage, .direct_IO = blkdev_direct_IO, + .migratepage = buffer_migrate_page_norefs, .is_dirty_writeback = buffer_check_dirty_writeback, }; _ Patches currently in -mm which might be from jack@xxxxxxx are mm-migration-factor-out-code-to-compute-expected-number-of-page-references.patch mm-migrate-lock-buffers-before-migrate_page_move_mapping.patch mm-migrate-move-migrate_page_lock_buffers.patch mm-migrate-provide-buffer_migrate_page_norefs.patch blkdev-avoid-migration-stalls-for-blkdev-pages.patch mm-migrate-drop-unused-argument-of-migrate_page_move_mapping.patch