Home Home > GIT Browse > SLE15
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Kara <jack@suse.cz>2019-01-03 13:30:33 +0100
committerJan Kara <jack@suse.cz>2019-01-21 09:16:10 +0100
commit32da7b48556a93d4ebb9d19a677658ae022dca2e (patch)
treefc12e780830ac0d1bd993ed9145a767fd3c3f88e
parentf94c281bebd72b84ebf34b3bf5f2601cf1bc3fe7 (diff)
blkdev: avoid migration stalls for blkdev pages (bsc#1084216).
-rw-r--r--patches.fixes/blkdev-avoid-migration-stalls-for-blkdev-pages.patch46
-rw-r--r--series.conf1
2 files changed, 47 insertions, 0 deletions
diff --git a/patches.fixes/blkdev-avoid-migration-stalls-for-blkdev-pages.patch b/patches.fixes/blkdev-avoid-migration-stalls-for-blkdev-pages.patch
new file mode 100644
index 0000000000..a4b2e6b167
--- /dev/null
+++ b/patches.fixes/blkdev-avoid-migration-stalls-for-blkdev-pages.patch
@@ -0,0 +1,46 @@
+From 88dbcbb3a4847f5e6dfeae952d3105497700c128 Mon Sep 17 00:00:00 2001
+From: Jan Kara <jack@suse.cz>
+Date: Fri, 28 Dec 2018 00:39:16 -0800
+Subject: [PATCH] blkdev: avoid migration stalls for blkdev pages
+Git-commit: 88dbcbb3a4847f5e6dfeae952d3105497700c128
+Patch-mainline: v4.21-rc1
+References: bsc#1084216
+
+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@suse.cz
+Signed-off-by: Jan Kara <jack@suse.cz>
+Acked-by: Mel Gorman <mgorman@suse.de>
+Cc: Michal Hocko <mhocko@suse.com>
+Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Acked-by: Jan Kara <jack@suse.cz>
+
+---
+ fs/block_dev.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/fs/block_dev.c b/fs/block_dev.c
+index a80b4f0ee7c4..de2135178e62 100644
+--- a/fs/block_dev.c
++++ b/fs/block_dev.c
+@@ -1966,6 +1966,7 @@ static const struct address_space_operations def_blk_aops = {
+ .writepages = blkdev_writepages,
+ .releasepage = blkdev_releasepage,
+ .direct_IO = blkdev_direct_IO,
++ .migratepage = buffer_migrate_page_norefs,
+ .is_dirty_writeback = buffer_check_dirty_writeback,
+ };
+
+--
+2.16.4
+
diff --git a/series.conf b/series.conf
index dbfceddf22..c2e0d107c0 100644
--- a/series.conf
+++ b/series.conf
@@ -19700,6 +19700,7 @@
patches.fixes/mm-migration-factor-out-code-to-compute-expected-num.patch
patches.fixes/mm-migrate-lock-buffers-before-migrate_page_move_map.patch
patches.fixes/mm-migrate-provide-buffer_migrate_page_norefs.patch
+ patches.fixes/blkdev-avoid-migration-stalls-for-blkdev-pages.patch
patches.drivers/gpiolib-Fix-return-value-of-gpio_to_desc-stub-if-GPI.patch
patches.drivers/power-supply-olpc_battery-correct-the-temperature-un.patch
patches.drivers/usb-dwc2-host-use-hrtimer-for-nak-retries.patch