summaryrefslogtreecommitdiffstats
path: root/block/blk-rq-qos.h
diff options
context:
space:
mode:
authorJosef Bacik <josef@toxicpanda.com>2018-12-04 18:59:02 +0100
committerJens Axboe <axboe@kernel.dk>2018-12-08 06:26:38 +0100
commit84f603246db9703aca05aad58b94a54dfbf44327 (patch)
treea2235d4f431e619f04292aea0349399ab4b8da68 /block/blk-rq-qos.h
parentblkcg: rename blkg_try_get() to blkg_tryget() (diff)
downloadlinux-84f603246db9703aca05aad58b94a54dfbf44327.tar.xz
linux-84f603246db9703aca05aad58b94a54dfbf44327.zip
block: add rq_qos_wait to rq_qos
Originally when I split out the common code from blk-wbt into rq_qos I left the wbt_wait() where it was and simply copied and modified it slightly to work for io-latency. However they are both basically the same thing, and as time has gone on wbt_wait() has ended up much smarter and kinder than it was when I copied it into io-latency, which means io-latency has lost out on these improvements. Since they are the same thing essentially except for a few minor things, create rq_qos_wait() that replicates what wbt_wait() currently does with callbacks that can be passed in for the snowflakes to do their own thing as appropriate. Signed-off-by: Josef Bacik <josef@toxicpanda.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/blk-rq-qos.h')
-rw-r--r--block/blk-rq-qos.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/block/blk-rq-qos.h b/block/blk-rq-qos.h
index 6e09e98b93ea..8678875de420 100644
--- a/block/blk-rq-qos.h
+++ b/block/blk-rq-qos.h
@@ -93,6 +93,12 @@ static inline void rq_qos_del(struct request_queue *q, struct rq_qos *rqos)
}
}
+typedef bool (acquire_inflight_cb_t)(struct rq_wait *rqw, void *private_data);
+typedef void (cleanup_cb_t)(struct rq_wait *rqw, void *private_data);
+
+void rq_qos_wait(struct rq_wait *rqw, void *private_data,
+ acquire_inflight_cb_t *acquire_inflight_cb,
+ cleanup_cb_t *cleanup_cb);
bool rq_wait_inc_below(struct rq_wait *rq_wait, unsigned int limit);
void rq_depth_scale_up(struct rq_depth *rqd);
void rq_depth_scale_down(struct rq_depth *rqd, bool hard_throttle);