diff mbox series

[3/3] block: rename BIO_QUEUE_ENTERED as BIO_SPLITTED

Message ID 20190515030310.20393-4-ming.lei@redhat.com (mailing list archive)
State New, archived
Headers show
Series block: queue exit cleanup | expand

Commit Message

Ming Lei May 15, 2019, 3:03 a.m. UTC
cd4a4ae4683d ("block: don't use blocking queue entered for recursive
bio submits") introduces BIO_QUEUE_ENTERED to avoid blocking queue entered
for recursive bio submits. Now there isn't such use any more. The only
one use is for cgroup accounting on splitted bio, so rename it
as BIO_SPLITTED.

Cc: Josef Bacik <josef@toxicpanda.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Ming Lei <ming.lei@redhat.com>
---
 block/blk-merge.c          | 10 +---------
 include/linux/blk-cgroup.h |  4 ++--
 include/linux/blk_types.h  |  2 +-
 3 files changed, 4 insertions(+), 12 deletions(-)

Comments

Josef Bacik May 15, 2019, 4:01 p.m. UTC | #1
On Wed, May 15, 2019 at 11:03:10AM +0800, Ming Lei wrote:
> cd4a4ae4683d ("block: don't use blocking queue entered for recursive
> bio submits") introduces BIO_QUEUE_ENTERED to avoid blocking queue entered
> for recursive bio submits. Now there isn't such use any more. The only
> one use is for cgroup accounting on splitted bio, so rename it
> as BIO_SPLITTED.
> 
> Cc: Josef Bacik <josef@toxicpanda.com>
> Cc: Christoph Hellwig <hch@lst.de>
> Cc: Bart Van Assche <bvanassche@acm.org>
> Signed-off-by: Ming Lei <ming.lei@redhat.com>

Reviewed-by: Josef Bacik <josef@toxicpanda.com>

Thanks,

Josef
Christoph Hellwig May 21, 2019, 12:59 p.m. UTC | #2
On Wed, May 15, 2019 at 11:03:10AM +0800, Ming Lei wrote:
> cd4a4ae4683d ("block: don't use blocking queue entered for recursive
> bio submits") introduces BIO_QUEUE_ENTERED to avoid blocking queue entered
> for recursive bio submits. Now there isn't such use any more. The only
> one use is for cgroup accounting on splitted bio, so rename it
> as BIO_SPLITTED.

Actually - this now is only used for accounting.  What about renaming the
flag to BIO_ACCOUNTED and just test and set it in blkcg_bio_issue_check?

That function looks way too big to be inline while we're at it..
diff mbox series

Patch

diff --git a/block/blk-merge.c b/block/blk-merge.c
index 21e87a714a73..5fd81cd86928 100644
--- a/block/blk-merge.c
+++ b/block/blk-merge.c
@@ -332,15 +332,7 @@  void blk_queue_split(struct request_queue *q, struct bio **bio)
 		/* there isn't chance to merge the splitted bio */
 		split->bi_opf |= REQ_NOMERGE;
 
-		/*
-		 * Since we're recursing into make_request here, ensure
-		 * that we mark this bio as already having entered the queue.
-		 * If not, and the queue is going away, we can get stuck
-		 * forever on waiting for the queue reference to drop. But
-		 * that will never happen, as we're already holding a
-		 * reference to it.
-		 */
-		bio_set_flag(*bio, BIO_QUEUE_ENTERED);
+		bio_set_flag(*bio, BIO_SPLITTED);
 
 		bio_chain(split, *bio);
 		trace_block_split(q, split, (*bio)->bi_iter.bi_sector);
diff --git a/include/linux/blk-cgroup.h b/include/linux/blk-cgroup.h
index 76c61318fda5..a24c9a04f79f 100644
--- a/include/linux/blk-cgroup.h
+++ b/include/linux/blk-cgroup.h
@@ -792,11 +792,11 @@  static inline bool blkcg_bio_issue_check(struct request_queue *q,
 
 	if (!throtl) {
 		/*
-		 * If the bio is flagged with BIO_QUEUE_ENTERED it means this
+		 * If the bio is flagged with BIO_SPLITTED it means this
 		 * is a split bio and we would have already accounted for the
 		 * size of the bio.
 		 */
-		if (!bio_flagged(bio, BIO_QUEUE_ENTERED))
+		if (!bio_flagged(bio, BIO_SPLITTED))
 			blkg_rwstat_add(&blkg->stat_bytes, bio->bi_opf,
 					bio->bi_iter.bi_size);
 		blkg_rwstat_add(&blkg->stat_ios, bio->bi_opf, 1);
diff --git a/include/linux/blk_types.h b/include/linux/blk_types.h
index be418275763c..d7235009f3a7 100644
--- a/include/linux/blk_types.h
+++ b/include/linux/blk_types.h
@@ -229,7 +229,7 @@  enum {
 				 * throttling rules. Don't do it again. */
 	BIO_TRACE_COMPLETION,	/* bio_endio() should trace the final completion
 				 * of this bio. */
-	BIO_QUEUE_ENTERED,	/* can use blk_queue_enter_live() */
+	BIO_SPLITTED,		/* splitted bio */
 	BIO_TRACKED,		/* set if bio goes through the rq_qos path */
 	BIO_FLAG_LAST
 };