@@ -7045,7 +7045,7 @@ static void bfq_exit_queue(struct elevator_queue *e)
#endif
blk_stat_disable_accounting(bfqd->queue);
- wbt_enable_default(bfqd->queue);
+ wbt_enable_default(bfqd->queue, false);
kfree(bfqd);
}
@@ -850,7 +850,7 @@ int blk_register_queue(struct gendisk *disk)
goto put_dev;
blk_queue_flag_set(QUEUE_FLAG_REGISTERED, q);
- wbt_enable_default(q);
+ wbt_enable_default(q, true);
blk_throtl_register_queue(q);
/* Now everything is ready and send out KOBJ_ADD uevent */
@@ -27,6 +27,7 @@
#include "blk-wbt.h"
#include "blk-rq-qos.h"
+#include "elevator.h"
#define CREATE_TRACE_POINTS
#include <trace/events/wbt.h>
@@ -643,10 +644,14 @@ void wbt_set_write_cache(struct request_queue *q, bool write_cache_on)
/*
* Enable wbt if defaults are configured that way
*/
-void wbt_enable_default(struct request_queue *q)
+void wbt_enable_default(struct request_queue *q, bool check_elevator)
{
struct rq_qos *rqos = wbt_rq_qos(q);
+ if (check_elevator && q->elevator &&
+ check_elevator_name(q->elevator, "bfq"))
+ return;
+
/* Throttling already enabled? */
if (rqos) {
if (RQWB(rqos)->enable_state == WBT_STATE_OFF_DEFAULT)
@@ -90,7 +90,7 @@ static inline unsigned int wbt_inflight(struct rq_wb *rwb)
int wbt_init(struct request_queue *);
void wbt_disable_default(struct request_queue *);
-void wbt_enable_default(struct request_queue *);
+void wbt_enable_default(struct request_queue *, bool);
u64 wbt_get_min_lat(struct request_queue *q);
void wbt_set_min_lat(struct request_queue *q, u64 val);
@@ -109,7 +109,8 @@ static inline int wbt_init(struct request_queue *q)
static inline void wbt_disable_default(struct request_queue *q)
{
}
-static inline void wbt_enable_default(struct request_queue *q)
+static inline void wbt_enable_default(struct request_queue *q,
+ bool check_elevator)
{
}
static inline void wbt_set_write_cache(struct request_queue *q, bool wc)