>From fa946405d137fbc9a433f9a150929e93f7f0b308 Mon Sep 17 00:00:00 2001 From: Minchan Kim Date: Fri, 27 Jul 2018 15:15:33 +0900 Subject: [PATCH 1/2] zram: remove BD_CAP_SYNCHRONOUS_IO with writeback feature 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 --- 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