History

block: replace BIO_QUEUE_ENTERED with BIO_CGROUP_ACCT

BIO_QUEUE_ENTERED is only used for cgroup accounting now, so rename the flag and move setting it into the cgroup code.

Christoph Hellwig committed 6 years ago

Commit 0376e9e1 parent 760f83e3 files · +7 −15Browse files

Unified · Split

3 files
  1. block/blk-merge.c +0 −10
  2. include/linux/blk-cgroup.h +6 −4
  3. include/linux/blk_types.h +1 −1
block/blk-merge.c+0−10
@@ -336,16 +336,6 @@ void __blk_queue_split(struct request_queue *q, struct bio **bio, · 335 unmodified lines
336 /* there isn't chance to merge the splitted bio */336 /* there isn't chance to merge the splitted bio */
337 split->bi_opf |= REQ_NOMERGE;337 split->bi_opf |= REQ_NOMERGE;
338 338
339 /*
340 * Since we're recursing into make_request here, ensure
341 * that we mark this bio as already having entered the queue.
342 * If not, and the queue is going away, we can get stuck
343 * forever on waiting for the queue reference to drop. But
344 * that will never happen, as we're already holding a
345 * reference to it.
346 */
347 bio_set_flag(*bio, BIO_QUEUE_ENTERED);
348
349 bio_chain(split, *bio);339 bio_chain(split, *bio);
350 trace_block_split(q, split, (*bio)->bi_iter.bi_sector);340 trace_block_split(q, split, (*bio)->bi_iter.bi_sector);
351 generic_make_request(*bio);341 generic_make_request(*bio);
include/linux/blk-cgroup.h+6−4
@@ -607,12 +607,14 @@ static inline bool blkcg_bio_issue_check(struct request_queue *q, · 606 unmodified lines
607 u64_stats_update_begin(&bis->sync);607 u64_stats_update_begin(&bis->sync);
608 608
609 /*609 /*
610 * If the bio is flagged with BIO_QUEUE_ENTERED it means this610 * If the bio is flagged with BIO_CGROUP_ACCT it means this is a
611 * is a split bio and we would have already accounted for the611 * split bio and we would have already accounted for the size of
612 * size of the bio.612 * the bio.
613 */613 */
614 if (!bio_flagged(bio, BIO_QUEUE_ENTERED))614 if (!bio_flagged(bio, BIO_CGROUP_ACCT)) {
615 bio_set_flag(bio, BIO_CGROUP_ACCT);
615 bis->cur.bytes[rwd] += bio->bi_iter.bi_size;616 bis->cur.bytes[rwd] += bio->bi_iter.bi_size;
617 }
616 bis->cur.ios[rwd]++;618 bis->cur.ios[rwd]++;
617 619
618 u64_stats_update_end(&bis->sync);620 u64_stats_update_end(&bis->sync);
include/linux/blk_types.h+1−1
@@ -220,7 +220,7 @@ enum { · 219 unmodified lines
220 * throttling rules. Don't do it again. */220 * throttling rules. Don't do it again. */
221 BIO_TRACE_COMPLETION, /* bio_endio() should trace the final completion221 BIO_TRACE_COMPLETION, /* bio_endio() should trace the final completion
222 * of this bio. */222 * of this bio. */
223 BIO_QUEUE_ENTERED, /* can use blk_queue_enter_live() */223 BIO_CGROUP_ACCT, /* has been accounted to a cgroup */
224 BIO_TRACKED, /* set if bio goes through the rq_qos path */224 BIO_TRACKED, /* set if bio goes through the rq_qos path */
225 BIO_FLAG_LAST225 BIO_FLAG_LAST
226};226};