BIO_QUEUE_ENTERED is only used for cgroup accounting now, so rename the flag and move setting it into the cgroup code.
Unified · Split
| @@ -336,16 +336,6 @@ void __blk_queue_split(struct request_queue *q, struct bio **bio, · 335 unmodified lines | ||
| 336 | 336 | /* there isn't chance to merge the splitted bio */ |
| 337 | 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 | 339 | bio_chain(split, *bio); |
| 350 | 340 | trace_block_split(q, split, (*bio)->bi_iter.bi_sector); |
| 351 | 341 | generic_make_request(*bio); |
| @@ -607,12 +607,14 @@ static inline bool blkcg_bio_issue_check(struct request_queue *q, · 606 unmodified lines | ||
| 607 | 607 | u64_stats_update_begin(&bis->sync); |
| 608 | 608 | |
| 609 | 609 | /* |
| 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. | |
| 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 | 616 | bis->cur.bytes[rwd] += bio->bi_iter.bi_size; |
| 617 | + } | |
| 616 | 618 | bis->cur.ios[rwd]++; |
| 617 | 619 | |
| 618 | 620 | u64_stats_update_end(&bis->sync); |
| @@ -220,7 +220,7 @@ enum { · 219 unmodified lines | ||
| 220 | 220 | * throttling rules. Don't do it again. */ |
| 221 | 221 | BIO_TRACE_COMPLETION, /* bio_endio() should trace the final completion |
| 222 | 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 | 224 | BIO_TRACKED, /* set if bio goes through the rq_qos path */ |
| 225 | 225 | BIO_FLAG_LAST |
| 226 | 226 | }; |