From 8330cdb0fe55c9a9a8e440e56c19233229e0e259 Mon Sep 17 00:00:00 2001 From: Jan Kara Date: Wed, 19 Apr 2017 11:33:27 +0200 Subject: block: Make writeback throttling defaults consistent for SQ devices When CFQ is used as an elevator, it disables writeback throttling because they don't play well together. Later when a different elevator is chosen for the device, writeback throttling doesn't get enabled again as it should. Make sure CFQ enables writeback throttling (if it should be enabled by default) when we switch from it to another IO scheduler. Signed-off-by: Jan Kara Signed-off-by: Jens Axboe --- block/elevator.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'block/elevator.c') diff --git a/block/elevator.c b/block/elevator.c index dbeecf7be719..fb50416b5aae 100644 --- a/block/elevator.c +++ b/block/elevator.c @@ -41,6 +41,7 @@ #include "blk.h" #include "blk-mq-sched.h" +#include "blk-wbt.h" static DEFINE_SPINLOCK(elv_list_lock); static LIST_HEAD(elv_list); @@ -877,6 +878,8 @@ void elv_unregister_queue(struct request_queue *q) kobject_uevent(&e->kobj, KOBJ_REMOVE); kobject_del(&e->kobj); e->registered = 0; + /* Re-enable throttling in case elevator disabled it */ + wbt_enable_default(q); } } EXPORT_SYMBOL(elv_unregister_queue); -- cgit v1.2.3-58-ga151