All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] block: Make writeback throttling defaults consistent for SQ devices
@ 2017-04-12  8:23 Jan Kara
  2017-04-14 15:42 ` Bart Van Assche
  0 siblings, 1 reply; 6+ messages in thread
From: Jan Kara @ 2017-04-12  8:23 UTC (permalink / raw)
  To: Jens Axboe; +Cc: linux-block, Jan Kara

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. Add support to NOOP and DEADLINE elevators to enable
writeback throttling if user set such defaults.

Signed-off-by: Jan Kara <jack@suse.cz>
---
 block/blk-sysfs.c        | 19 +------------------
 block/blk-wbt.c          | 24 ++++++++++++++++++++++++
 block/blk-wbt.h          |  4 ++++
 block/deadline-iosched.c |  7 +++++++
 block/noop-iosched.c     |  7 +++++++
 5 files changed, 43 insertions(+), 18 deletions(-)

diff --git a/block/blk-sysfs.c b/block/blk-sysfs.c
index fc20489f0d2b..f85723332288 100644
--- a/block/blk-sysfs.c
+++ b/block/blk-sysfs.c
@@ -844,23 +844,6 @@ struct kobj_type blk_queue_ktype = {
 	.release	= blk_release_queue,
 };
 
-static void blk_wb_init(struct request_queue *q)
-{
-#ifndef CONFIG_BLK_WBT_MQ
-	if (q->mq_ops)
-		return;
-#endif
-#ifndef CONFIG_BLK_WBT_SQ
-	if (q->request_fn)
-		return;
-#endif
-
-	/*
-	 * If this fails, we don't get throttling
-	 */
-	wbt_init(q);
-}
-
 int blk_register_queue(struct gendisk *disk)
 {
 	int ret;
@@ -908,7 +891,7 @@ int blk_register_queue(struct gendisk *disk)
 
 	kobject_uevent(&q->kobj, KOBJ_ADD);
 
-	blk_wb_init(q);
+	wbt_enable_default(q);
 
 	blk_throtl_register_queue(q);
 
diff --git a/block/blk-wbt.c b/block/blk-wbt.c
index b3b79149d3a0..22fb33cc35f1 100644
--- a/block/blk-wbt.c
+++ b/block/blk-wbt.c
@@ -665,6 +665,30 @@ void wbt_disable_default(struct request_queue *q)
 }
 EXPORT_SYMBOL_GPL(wbt_disable_default);
 
+/*
+ * Enable wbt if defaults are configured that way
+ */
+void wbt_enable_default(struct request_queue *q)
+{
+	if (q->rq_wb)
+		return;
+
+#ifndef CONFIG_BLK_WBT_MQ
+	if (q->mq_ops)
+		return;
+#endif
+#ifndef CONFIG_BLK_WBT_SQ
+	if (q->request_fn)
+		return;
+#endif
+
+	/*
+	 * If this fails, we don't get throttling
+	 */
+	wbt_init(q);
+}
+EXPORT_SYMBOL_GPL(wbt_enable_default);
+
 u64 wbt_default_latency_nsec(struct request_queue *q)
 {
 	/*
diff --git a/block/blk-wbt.h b/block/blk-wbt.h
index ad6c78507c3a..df6de50c5d59 100644
--- a/block/blk-wbt.h
+++ b/block/blk-wbt.h
@@ -117,6 +117,7 @@ void wbt_update_limits(struct rq_wb *);
 void wbt_requeue(struct rq_wb *, struct blk_issue_stat *);
 void wbt_issue(struct rq_wb *, struct blk_issue_stat *);
 void wbt_disable_default(struct request_queue *);
+void wbt_enable_default(struct request_queue *);
 
 void wbt_set_queue_depth(struct rq_wb *, unsigned int);
 void wbt_set_write_cache(struct rq_wb *, bool);
@@ -155,6 +156,9 @@ static inline void wbt_issue(struct rq_wb *rwb, struct blk_issue_stat *stat)
 static inline void wbt_disable_default(struct request_queue *q)
 {
 }
+static inline void wbt_enable_default(struct request_queue *q)
+{
+}
 static inline void wbt_set_queue_depth(struct rq_wb *rwb, unsigned int depth)
 {
 }
diff --git a/block/deadline-iosched.c b/block/deadline-iosched.c
index c68f6bbc0dcd..71210b66f019 100644
--- a/block/deadline-iosched.c
+++ b/block/deadline-iosched.c
@@ -13,6 +13,7 @@
 #include <linux/init.h>
 #include <linux/compiler.h>
 #include <linux/rbtree.h>
+#include "blk-wbt.h"
 
 /*
  * See Documentation/block/deadline-iosched.txt
@@ -363,6 +364,11 @@ static int deadline_init_queue(struct request_queue *q, struct elevator_type *e)
 	return 0;
 }
 
+static void deadline_registered_queue(struct request_queue *q)
+{
+	wbt_enable_default(q);
+}
+
 /*
  * sysfs parts below
  */
@@ -445,6 +451,7 @@ static struct elevator_type iosched_deadline = {
 		.elevator_latter_req_fn =	elv_rb_latter_request,
 		.elevator_init_fn =		deadline_init_queue,
 		.elevator_exit_fn =		deadline_exit_queue,
+		.elevator_registered_fn =	deadline_registered_queue,
 	},
 
 	.elevator_attrs = deadline_attrs,
diff --git a/block/noop-iosched.c b/block/noop-iosched.c
index 2d1b15d89b45..92f747d6b9c2 100644
--- a/block/noop-iosched.c
+++ b/block/noop-iosched.c
@@ -7,6 +7,7 @@
 #include <linux/module.h>
 #include <linux/slab.h>
 #include <linux/init.h>
+#include "blk-wbt.h"
 
 struct noop_data {
 	struct list_head queue;
@@ -91,6 +92,11 @@ static void noop_exit_queue(struct elevator_queue *e)
 	kfree(nd);
 }
 
+static void noop_registered_queue(struct request_queue *q)
+{
+	wbt_enable_default(q);
+}
+
 static struct elevator_type elevator_noop = {
 	.ops.sq = {
 		.elevator_merge_req_fn		= noop_merged_requests,
@@ -100,6 +106,7 @@ static struct elevator_type elevator_noop = {
 		.elevator_latter_req_fn		= noop_latter_request,
 		.elevator_init_fn		= noop_init_queue,
 		.elevator_exit_fn		= noop_exit_queue,
+		.elevator_registered_fn		= noop_registered_queue,
 	},
 	.elevator_name = "noop",
 	.elevator_owner = THIS_MODULE,
-- 
2.12.0

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] block: Make writeback throttling defaults consistent for SQ devices
  2017-04-12  8:23 [PATCH] block: Make writeback throttling defaults consistent for SQ devices Jan Kara
@ 2017-04-14 15:42 ` Bart Van Assche
  2017-04-18 12:25   ` Jan Kara
  0 siblings, 1 reply; 6+ messages in thread
From: Bart Van Assche @ 2017-04-14 15:42 UTC (permalink / raw)
  To: jack, axboe; +Cc: linux-block

On Wed, 2017-04-12 at 10:23 +0200, Jan Kara wrote:
> +#ifndef CONFIG_BLK_WBT_MQ
> +	if (q->mq_ops)
> +		return;
> +#endif
> +#ifndef CONFIG_BLK_WBT_SQ
> +	if (q->request_fn)
> +		return;
> +#endif
> +
> +	/*
> +	 * If this fails, we don't get throttling
> +	 */
> +	wbt_init(q);

Hello Jan,

How about using positive logic to enable WBT, e.g. as follows? Wouldn't
that make the code easier to read?

	if ((IS_ENABLED(CONFIG_BLK_WBT_MQ) &&=A0q->mq_ops) ||
	    (IS_ENABLED(CONFIG_BLK_WBT_SQ) && q->request_fn))
		wbt_init(q);

> +static void deadline_registered_queue(struct request_queue *q)
> +{
> +	wbt_enable_default(q);
> +}
> +
>  /*
>   * sysfs parts below
>   */
> @@ -445,6 +451,7 @@ static struct elevator_type iosched_deadline =3D {
>  		.elevator_latter_req_fn =3D	elv_rb_latter_request,
>  		.elevator_init_fn =3D		deadline_init_queue,
>  		.elevator_exit_fn =3D		deadline_exit_queue,
> +		.elevator_registered_fn =3D	deadline_registered_queue,
>  	},
> =20
>  	.elevator_attrs =3D deadline_attrs,
> [ ... ]
> @@ -91,6 +92,11 @@ static void noop_exit_queue(struct elevator_queue *e)
>  	kfree(nd);
>  }
> =20
> +static void noop_registered_queue(struct request_queue *q)
> +{
> +	wbt_enable_default(q);
> +}
> +
>  static struct elevator_type elevator_noop =3D {
>  	.ops.sq =3D {
>  		.elevator_merge_req_fn		=3D noop_merged_requests,
> @@ -100,6 +106,7 @@ static struct elevator_type elevator_noop =3D {
>  		.elevator_latter_req_fn		=3D noop_latter_request,
>  		.elevator_init_fn		=3D noop_init_queue,
>  		.elevator_exit_fn		=3D noop_exit_queue,
> +		.elevator_registered_fn		=3D noop_registered_queue,
>  	},
>  	.elevator_name =3D "noop",
>  	.elevator_owner =3D THIS_MODULE,

This approach is not suited for blk-mq because with blk-mq "none" means no
scheduler and hence no struct elevator_type. Please consider not to add any
elevator_registered_fn() callbacks to noop and deadline but instead to call
wbt_enable_default() from elv_unregister_queue().

Thanks,

Bart.=

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] block: Make writeback throttling defaults consistent for SQ devices
  2017-04-14 15:42 ` Bart Van Assche
@ 2017-04-18 12:25   ` Jan Kara
  0 siblings, 0 replies; 6+ messages in thread
From: Jan Kara @ 2017-04-18 12:25 UTC (permalink / raw)
  To: Bart Van Assche; +Cc: jack, axboe, linux-block

Hello Bart,

On Fri 14-04-17 15:42:53, Bart Van Assche wrote:
> On Wed, 2017-04-12 at 10:23 +0200, Jan Kara wrote:
> > +#ifndef CONFIG_BLK_WBT_MQ
> > +	if (q->mq_ops)
> > +		return;
> > +#endif
> > +#ifndef CONFIG_BLK_WBT_SQ
> > +	if (q->request_fn)
> > +		return;
> > +#endif
> > +
> > +	/*
> > +	 * If this fails, we don't get throttling
> > +	 */
> > +	wbt_init(q);
> 
> How about using positive logic to enable WBT, e.g. as follows? Wouldn't
> that make the code easier to read?
> 
> 	if ((IS_ENABLED(CONFIG_BLK_WBT_MQ) &&�q->mq_ops) ||
> 	    (IS_ENABLED(CONFIG_BLK_WBT_SQ) && q->request_fn))
> 		wbt_init(q);

Yes, it is more readable. I was just copying the function around so I
didn't change it from the original but I guess I could add this cleanup to
make things more readable.

> > +static void deadline_registered_queue(struct request_queue *q)
> > +{
> > +	wbt_enable_default(q);
> > +}
> > +
> >  /*
> >   * sysfs parts below
> >   */
> > @@ -445,6 +451,7 @@ static struct elevator_type iosched_deadline = {
> >  		.elevator_latter_req_fn =	elv_rb_latter_request,
> >  		.elevator_init_fn =		deadline_init_queue,
> >  		.elevator_exit_fn =		deadline_exit_queue,
> > +		.elevator_registered_fn =	deadline_registered_queue,
> >  	},
> >  
> >  	.elevator_attrs = deadline_attrs,
> > [ ... ]
> > @@ -91,6 +92,11 @@ static void noop_exit_queue(struct elevator_queue *e)
> >  	kfree(nd);
> >  }
> >  
> > +static void noop_registered_queue(struct request_queue *q)
> > +{
> > +	wbt_enable_default(q);
> > +}
> > +
> >  static struct elevator_type elevator_noop = {
> >  	.ops.sq = {
> >  		.elevator_merge_req_fn		= noop_merged_requests,
> > @@ -100,6 +106,7 @@ static struct elevator_type elevator_noop = {
> >  		.elevator_latter_req_fn		= noop_latter_request,
> >  		.elevator_init_fn		= noop_init_queue,
> >  		.elevator_exit_fn		= noop_exit_queue,
> > +		.elevator_registered_fn		= noop_registered_queue,
> >  	},
> >  	.elevator_name = "noop",
> >  	.elevator_owner = THIS_MODULE,
> 
> This approach is not suited for blk-mq because with blk-mq "none" means no
> scheduler and hence no struct elevator_type. Please consider not to add any
> elevator_registered_fn() callbacks to noop and deadline but instead to call
> wbt_enable_default() from elv_unregister_queue().

So I was not much concerned about how to make blk-mq enable the writeback
throttling as you cannot switch between legacy and blk-mq path dynamically
and thus writeback throttling cannot get disabled. And for legacy path
using elevator_registered_fn is a natural choice.

I agree that using elv_unregister_queue() to enable writeback throttling
would work as well and may be easier to reuse if we ever want to make
similar auto-disabling work e.g. with BFQ. So unless someone objects I can
redo my patch that way.

								Honza
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] block: Make writeback throttling defaults consistent for SQ devices
  2017-04-19  9:33 Jan Kara
  2017-04-19  9:41 ` Jan Kara
@ 2017-04-19 14:34 ` Jens Axboe
  1 sibling, 0 replies; 6+ messages in thread
From: Jens Axboe @ 2017-04-19 14:34 UTC (permalink / raw)
  To: Jan Kara; +Cc: linux-block, Bart Van Assche

On 04/19/2017 03:33 AM, Jan Kara wrote:
> 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.

Thanks Jan, added.

-- 
Jens Axboe

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] block: Make writeback throttling defaults consistent for SQ devices
  2017-04-19  9:33 Jan Kara
@ 2017-04-19  9:41 ` Jan Kara
  2017-04-19 14:34 ` Jens Axboe
  1 sibling, 0 replies; 6+ messages in thread
From: Jan Kara @ 2017-04-19  9:41 UTC (permalink / raw)
  To: Jens Axboe; +Cc: linux-block, Bart Van Assche, Jan Kara

On Wed 19-04-17 11:33:27, Jan Kara wrote:
> 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 <jack@suse.cz>

Forgot to change header to v2 so I'm rather writing it here so that it's
clear.

								Honza

> ---
>  block/blk-sysfs.c | 19 +------------------
>  block/blk-wbt.c   | 19 +++++++++++++++++++
>  block/blk-wbt.h   |  4 ++++
>  block/elevator.c  |  3 +++
>  4 files changed, 27 insertions(+), 18 deletions(-)
> 
> diff --git a/block/blk-sysfs.c b/block/blk-sysfs.c
> index fc20489f0d2b..f85723332288 100644
> --- a/block/blk-sysfs.c
> +++ b/block/blk-sysfs.c
> @@ -844,23 +844,6 @@ struct kobj_type blk_queue_ktype = {
>  	.release	= blk_release_queue,
>  };
>  
> -static void blk_wb_init(struct request_queue *q)
> -{
> -#ifndef CONFIG_BLK_WBT_MQ
> -	if (q->mq_ops)
> -		return;
> -#endif
> -#ifndef CONFIG_BLK_WBT_SQ
> -	if (q->request_fn)
> -		return;
> -#endif
> -
> -	/*
> -	 * If this fails, we don't get throttling
> -	 */
> -	wbt_init(q);
> -}
> -
>  int blk_register_queue(struct gendisk *disk)
>  {
>  	int ret;
> @@ -908,7 +891,7 @@ int blk_register_queue(struct gendisk *disk)
>  
>  	kobject_uevent(&q->kobj, KOBJ_ADD);
>  
> -	blk_wb_init(q);
> +	wbt_enable_default(q);
>  
>  	blk_throtl_register_queue(q);
>  
> diff --git a/block/blk-wbt.c b/block/blk-wbt.c
> index b3b79149d3a0..26e1bb617877 100644
> --- a/block/blk-wbt.c
> +++ b/block/blk-wbt.c
> @@ -665,6 +665,25 @@ void wbt_disable_default(struct request_queue *q)
>  }
>  EXPORT_SYMBOL_GPL(wbt_disable_default);
>  
> +/*
> + * Enable wbt if defaults are configured that way
> + */
> +void wbt_enable_default(struct request_queue *q)
> +{
> +	/* Throttling already enabled? */
> +	if (q->rq_wb)
> +		return;
> +
> +	/* Queue not registered? Maybe shutting down... */
> +	if (!test_bit(QUEUE_FLAG_REGISTERED, &q->queue_flags))
> +		return;
> +
> +	if ((q->mq_ops && IS_ENABLED(CONFIG_BLK_WBT_MQ)) ||
> +	    (q->request_fn && IS_ENABLED(CONFIG_BLK_WBT_SQ)))
> +		wbt_init(q);
> +}
> +EXPORT_SYMBOL_GPL(wbt_enable_default);
> +
>  u64 wbt_default_latency_nsec(struct request_queue *q)
>  {
>  	/*
> diff --git a/block/blk-wbt.h b/block/blk-wbt.h
> index ad6c78507c3a..df6de50c5d59 100644
> --- a/block/blk-wbt.h
> +++ b/block/blk-wbt.h
> @@ -117,6 +117,7 @@ void wbt_update_limits(struct rq_wb *);
>  void wbt_requeue(struct rq_wb *, struct blk_issue_stat *);
>  void wbt_issue(struct rq_wb *, struct blk_issue_stat *);
>  void wbt_disable_default(struct request_queue *);
> +void wbt_enable_default(struct request_queue *);
>  
>  void wbt_set_queue_depth(struct rq_wb *, unsigned int);
>  void wbt_set_write_cache(struct rq_wb *, bool);
> @@ -155,6 +156,9 @@ static inline void wbt_issue(struct rq_wb *rwb, struct blk_issue_stat *stat)
>  static inline void wbt_disable_default(struct request_queue *q)
>  {
>  }
> +static inline void wbt_enable_default(struct request_queue *q)
> +{
> +}
>  static inline void wbt_set_queue_depth(struct rq_wb *rwb, unsigned int depth)
>  {
>  }
> 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);
> -- 
> 2.12.0
> 
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH] block: Make writeback throttling defaults consistent for SQ devices
@ 2017-04-19  9:33 Jan Kara
  2017-04-19  9:41 ` Jan Kara
  2017-04-19 14:34 ` Jens Axboe
  0 siblings, 2 replies; 6+ messages in thread
From: Jan Kara @ 2017-04-19  9:33 UTC (permalink / raw)
  To: Jens Axboe; +Cc: linux-block, Bart Van Assche, Jan Kara

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 <jack@suse.cz>
---
 block/blk-sysfs.c | 19 +------------------
 block/blk-wbt.c   | 19 +++++++++++++++++++
 block/blk-wbt.h   |  4 ++++
 block/elevator.c  |  3 +++
 4 files changed, 27 insertions(+), 18 deletions(-)

diff --git a/block/blk-sysfs.c b/block/blk-sysfs.c
index fc20489f0d2b..f85723332288 100644
--- a/block/blk-sysfs.c
+++ b/block/blk-sysfs.c
@@ -844,23 +844,6 @@ struct kobj_type blk_queue_ktype = {
 	.release	= blk_release_queue,
 };
 
-static void blk_wb_init(struct request_queue *q)
-{
-#ifndef CONFIG_BLK_WBT_MQ
-	if (q->mq_ops)
-		return;
-#endif
-#ifndef CONFIG_BLK_WBT_SQ
-	if (q->request_fn)
-		return;
-#endif
-
-	/*
-	 * If this fails, we don't get throttling
-	 */
-	wbt_init(q);
-}
-
 int blk_register_queue(struct gendisk *disk)
 {
 	int ret;
@@ -908,7 +891,7 @@ int blk_register_queue(struct gendisk *disk)
 
 	kobject_uevent(&q->kobj, KOBJ_ADD);
 
-	blk_wb_init(q);
+	wbt_enable_default(q);
 
 	blk_throtl_register_queue(q);
 
diff --git a/block/blk-wbt.c b/block/blk-wbt.c
index b3b79149d3a0..26e1bb617877 100644
--- a/block/blk-wbt.c
+++ b/block/blk-wbt.c
@@ -665,6 +665,25 @@ void wbt_disable_default(struct request_queue *q)
 }
 EXPORT_SYMBOL_GPL(wbt_disable_default);
 
+/*
+ * Enable wbt if defaults are configured that way
+ */
+void wbt_enable_default(struct request_queue *q)
+{
+	/* Throttling already enabled? */
+	if (q->rq_wb)
+		return;
+
+	/* Queue not registered? Maybe shutting down... */
+	if (!test_bit(QUEUE_FLAG_REGISTERED, &q->queue_flags))
+		return;
+
+	if ((q->mq_ops && IS_ENABLED(CONFIG_BLK_WBT_MQ)) ||
+	    (q->request_fn && IS_ENABLED(CONFIG_BLK_WBT_SQ)))
+		wbt_init(q);
+}
+EXPORT_SYMBOL_GPL(wbt_enable_default);
+
 u64 wbt_default_latency_nsec(struct request_queue *q)
 {
 	/*
diff --git a/block/blk-wbt.h b/block/blk-wbt.h
index ad6c78507c3a..df6de50c5d59 100644
--- a/block/blk-wbt.h
+++ b/block/blk-wbt.h
@@ -117,6 +117,7 @@ void wbt_update_limits(struct rq_wb *);
 void wbt_requeue(struct rq_wb *, struct blk_issue_stat *);
 void wbt_issue(struct rq_wb *, struct blk_issue_stat *);
 void wbt_disable_default(struct request_queue *);
+void wbt_enable_default(struct request_queue *);
 
 void wbt_set_queue_depth(struct rq_wb *, unsigned int);
 void wbt_set_write_cache(struct rq_wb *, bool);
@@ -155,6 +156,9 @@ static inline void wbt_issue(struct rq_wb *rwb, struct blk_issue_stat *stat)
 static inline void wbt_disable_default(struct request_queue *q)
 {
 }
+static inline void wbt_enable_default(struct request_queue *q)
+{
+}
 static inline void wbt_set_queue_depth(struct rq_wb *rwb, unsigned int depth)
 {
 }
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);
-- 
2.12.0

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-04-19 14:34 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-12  8:23 [PATCH] block: Make writeback throttling defaults consistent for SQ devices Jan Kara
2017-04-14 15:42 ` Bart Van Assche
2017-04-18 12:25   ` Jan Kara
2017-04-19  9:33 Jan Kara
2017-04-19  9:41 ` Jan Kara
2017-04-19 14:34 ` Jens Axboe

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.