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
336336 /* there isn't chance to merge the splitted bio */
337337 split->bi_opf |= REQ_NOMERGE;
338338
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−
349339 bio_chain(split, *bio);
350340 trace_block_split(q, split, (*bio)->bi_iter.bi_sector);
351341 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
607607 u64_stats_update_begin(&bis->sync);
608608
609609 /*
610− * If the bio is flagged with BIO_QUEUE_ENTERED it means this
611− * is a split bio and we would have already accounted for the
612− * size of the bio.
610+ * If the bio is flagged with BIO_CGROUP_ACCT it means this is a
611+ * split bio and we would have already accounted for the size of
612+ * the bio.
613613 */
614− if (!bio_flagged(bio, BIO_QUEUE_ENTERED))
614+ if (!bio_flagged(bio, BIO_CGROUP_ACCT)) {
615+ bio_set_flag(bio, BIO_CGROUP_ACCT);
615616 bis->cur.bytes[rwd] += bio->bi_iter.bi_size;
617+ }
616618 bis->cur.ios[rwd]++;
617619
618620 u64_stats_update_end(&bis->sync);
include/linux/blk_types.h+1−1
@@ -220,7 +220,7 @@ enum { · 219 unmodified lines
220220 * throttling rules. Don't do it again. */
221221 BIO_TRACE_COMPLETION, /* bio_endio() should trace the final completion
222222 * of this bio. */
223− BIO_QUEUE_ENTERED, /* can use blk_queue_enter_live() */
223+ BIO_CGROUP_ACCT, /* has been accounted to a cgroup */
224224 BIO_TRACKED, /* set if bio goes through the rq_qos path */
225225 BIO_FLAG_LAST
226226 };