]> git.baikalelectronics.ru Git - kernel.git/commitdiff
block: replace BIO_QUEUE_ENTERED with BIO_CGROUP_ACCT
authorChristoph Hellwig <hch@lst.de>
Tue, 28 Apr 2020 11:27:55 +0000 (13:27 +0200)
committerJens Axboe <axboe@kernel.dk>
Wed, 29 Apr 2020 15:33:26 +0000 (09:33 -0600)
BIO_QUEUE_ENTERED is only used for cgroup accounting now, so rename
the flag and move setting it into the cgroup code.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/blk-merge.c
include/linux/blk-cgroup.h
include/linux/blk_types.h

index c49eb3bdd0be8b5950b5130e5bc50892bde7d2f8..a04e991b5ded96716eeee0d02706ddf0d4cb38ee 100644 (file)
@@ -336,16 +336,6 @@ 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_chain(split, *bio);
                trace_block_split(q, split, (*bio)->bi_iter.bi_sector);
                generic_make_request(*bio);
index 35f8ffe92b702bb62550c6983614ff857335c2cb..4deb8bb7b6afaef8eabc09ee557a66e403e4a6da 100644 (file)
@@ -607,12 +607,14 @@ static inline bool blkcg_bio_issue_check(struct request_queue *q,
                u64_stats_update_begin(&bis->sync);
 
                /*
-                * If the bio is flagged with BIO_QUEUE_ENTERED it means this
-                * is a split bio and we would have already accounted for the
-                * size of the bio.
+                * If the bio is flagged with BIO_CGROUP_ACCT 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_CGROUP_ACCT)) {
+                       bio_set_flag(bio, BIO_CGROUP_ACCT);
                        bis->cur.bytes[rwd] += bio->bi_iter.bi_size;
+               }
                bis->cur.ios[rwd]++;
 
                u64_stats_update_end(&bis->sync);
index 31eb92876be7ccf2d48f6c453f312b371bcdda50..90895d594e647d4a247696df5dd01cf5f514fd2d 100644 (file)
@@ -220,7 +220,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_CGROUP_ACCT,        /* has been accounted to a cgroup */
        BIO_TRACKED,            /* set if bio goes through the rq_qos path */
        BIO_FLAG_LAST
 };