[PATCH 1/2] zram: remove BD_CAP_SYNCHRONOUS_IO with writeback feature

From: Minchan Kim
Date: Fri Jul 27 2018 - 02:15:33 EST


If zram supports writeback feature, it's no more syncrhonous
device beause we need asynchronous IO opeation.

Do not pretend to be syncrhonous IO device.
It makes system very sluggish as waiting IO completion from
upper layer.

Signed-off-by: Minchan Kim <minchan@xxxxxxxxxx>
---
drivers/block/zram/zram_drv.c | 5 +++++
1 file changed, 5 insertions(+)

diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c
index 7436b2d27fa3..8610987b7b5a 100644
--- a/drivers/block/zram/zram_drv.c
+++ b/drivers/block/zram/zram_drv.c
@@ -1699,6 +1699,11 @@ static int zram_add(void)

zram->disk->queue->backing_dev_info->capabilities |=
(BDI_CAP_STABLE_WRITES | BDI_CAP_SYNCHRONOUS_IO);
+#if CONFIG_ZRAM_WRITEBACK
+ if (zram->backing_dev)
+ zram->disk->queue->backing_dev_info->capabilities &=
+ ~BDI_CAP_SYNCHRONOUS_IO;
+#endif
add_disk(zram->disk);

ret = sysfs_create_group(&disk_to_dev(zram->disk)->kobj,
--
2.18.0.345.g5c9ce644c3-goog


--tThc/1wpZn/ma/RB
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment; filename="0002-swap-free-allocated-page-if-swap_read-fails.patch"