From: Josef Bacik <josef@toxicpanda.com>
To: axboe@kernel.dk, linux-kernel@vger.kernel.org,
akpm@linux-foundation.org, hannes@cmpxchg.org, tj@kernel.org,
linux-fsdevel@vger.kernel.org, linux-block@vger.kernel.org,
kernel-team@fb.com
Cc: Josef Bacik <jbacik@fb.com>
Subject: [PATCH 11/14] rq-qos: introduce dio_bio callback
Date: Tue, 3 Jul 2018 11:15:00 -0400 [thread overview]
Message-ID: <20180703151503.2549-12-josef@toxicpanda.com> (raw)
In-Reply-To: <20180703151503.2549-1-josef@toxicpanda.com>
From: Josef Bacik <jbacik@fb.com>
wbt cares only about request completion time, but controllers may need
information that is on the bio itself, so add a done_bio callback for
rq-qos so things like blk-iolatency can use it to have the bio when it
completes.
Signed-off-by: Josef Bacik <jbacik@fb.com>
---
block/bio.c | 4 ++++
block/blk-rq-qos.c | 10 ++++++++++
block/blk-rq-qos.h | 2 ++
3 files changed, 16 insertions(+)
diff --git a/block/bio.c b/block/bio.c
index e09f3626ab5b..5df998515adc 100644
--- a/block/bio.c
+++ b/block/bio.c
@@ -32,6 +32,7 @@
#include <trace/events/block.h>
#include "blk.h"
+#include "blk-rq-qos.h"
/*
* Test patch to inline a certain number of bi_io_vec's inside the bio
@@ -1808,6 +1809,9 @@ void bio_endio(struct bio *bio)
if (!bio_integrity_endio(bio))
return;
+ if (bio->bi_disk)
+ rq_qos_done_bio(bio->bi_disk->queue, bio);
+
/*
* Need to have a real endio function for chained bios, otherwise
* various corner cases will break (like stacking block devices that
diff --git a/block/blk-rq-qos.c b/block/blk-rq-qos.c
index b7b02e04f64f..5134b24482f6 100644
--- a/block/blk-rq-qos.c
+++ b/block/blk-rq-qos.c
@@ -88,6 +88,16 @@ void rq_qos_track(struct request_queue *q, struct request *rq, struct bio *bio)
}
}
+void rq_qos_done_bio(struct request_queue *q, struct bio *bio)
+{
+ struct rq_qos *rqos;
+
+ for(rqos = q->rq_qos; rqos; rqos = rqos->next) {
+ if (rqos->ops->done_bio)
+ rqos->ops->done_bio(rqos, bio);
+ }
+}
+
/*
* Return true, if we can't increase the depth further by scaling
*/
diff --git a/block/blk-rq-qos.h b/block/blk-rq-qos.h
index a6d13b8ce0dc..d5e2f68fe41e 100644
--- a/block/blk-rq-qos.h
+++ b/block/blk-rq-qos.h
@@ -30,6 +30,7 @@ struct rq_qos_ops {
void (*issue)(struct rq_qos *, struct request *);
void (*requeue)(struct rq_qos *, struct request *);
void (*done)(struct rq_qos *, struct request *);
+ void (*done_bio)(struct rq_qos *, struct bio *);
void (*cleanup)(struct rq_qos *, struct bio *);
void (*exit)(struct rq_qos *);
};
@@ -101,6 +102,7 @@ void rq_qos_cleanup(struct request_queue *, struct bio *);
void rq_qos_done(struct request_queue *, struct request *);
void rq_qos_issue(struct request_queue *, struct request *);
void rq_qos_requeue(struct request_queue *, struct request *);
+void rq_qos_done_bio(struct request_queue *q, struct bio *bio);
void rq_qos_throttle(struct request_queue *, struct bio *, spinlock_t *);
void rq_qos_track(struct request_queue *q, struct request *, struct bio *);
void rq_qos_exit(struct request_queue *);
--
2.14.3
next prev parent reply other threads:[~2018-07-03 15:15 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-03 15:14 [PATCH 0/14][V6] Introduce io.latency io controller for cgroups Josef Bacik
2018-07-03 15:14 ` [PATCH 01/14] block: add bi_blkg to the bio " Josef Bacik
2018-07-03 15:14 ` [PATCH 02/14] block: introduce bio_issue_as_root_blkg Josef Bacik
2018-07-03 15:14 ` [PATCH 03/14] blk-cgroup: allow controllers to output their own stats Josef Bacik
2018-07-03 15:14 ` [PATCH 04/14] blk: introduce REQ_SWAP Josef Bacik
2018-07-03 15:14 ` [PATCH 05/14] swap,blkcg: issue swap io with the appropriate context Josef Bacik
2018-07-03 19:27 ` Randy Dunlap
2018-07-03 19:32 ` Jens Axboe
2018-07-03 15:14 ` [PATCH 06/14] blkcg: add generic throttling mechanism Josef Bacik
2018-08-05 12:41 ` Konstantin Khlebnikov
2018-07-03 15:14 ` [PATCH 07/14] memcontrol: schedule throttling if we are congested Josef Bacik
2018-07-03 15:14 ` [PATCH 08/14] blk-stat: export helpers for modifying blk_rq_stat Josef Bacik
2018-07-03 15:14 ` [PATCH 09/14] blk-rq-qos: refactor out common elements of blk-wbt Josef Bacik
2018-07-03 15:14 ` [PATCH 10/14] block: remove external dependency on wbt_flags Josef Bacik
2018-07-03 15:15 ` Josef Bacik [this message]
2018-07-03 19:29 ` [PATCH 11/14] rq-qos: introduce dio_bio callback Randy Dunlap
2018-07-03 19:33 ` Jens Axboe
2018-07-03 15:15 ` [PATCH 12/14] block: introduce blk-iolatency io controller Josef Bacik
2018-07-03 19:32 ` Randy Dunlap
2018-07-03 15:15 ` [PATCH 13/14] Documentation: add a doc for blk-iolatency Josef Bacik
2018-07-03 22:28 ` Randy Dunlap
2018-08-05 12:40 ` Konstantin Khlebnikov
2018-07-03 15:15 ` [PATCH 14/14] skip readahead if the cgroup is congested Josef Bacik
2018-07-03 15:37 ` [PATCH 0/14][V6] Introduce io.latency io controller for cgroups Jens Axboe
-- strict thread matches above, loose matches on Subject: below --
2018-06-29 19:25 [PATCH 00/14][V5] " Josef Bacik
2018-06-29 19:25 ` [PATCH 11/14] rq-qos: introduce dio_bio callback Josef Bacik
2018-06-27 19:09 [PATCH 00/14][V4] Introduce io.latency io controller for cgroups Josef Bacik
2018-06-27 19:09 ` [PATCH 11/14] rq-qos: introduce dio_bio callback Josef Bacik
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180703151503.2549-12-josef@toxicpanda.com \
--to=josef@toxicpanda.com \
--cc=akpm@linux-foundation.org \
--cc=axboe@kernel.dk \
--cc=hannes@cmpxchg.org \
--cc=jbacik@fb.com \
--cc=kernel-team@fb.com \
--cc=linux-block@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tj@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).