Lines Matching defs:bio
106 * fill up and a bio which is ready to be issued has to wait for a request
567 struct bio *bio;
717 static void iocg_commit_bio(struct ioc_gq *iocg, struct bio *bio,
722 bio->bi_iocost_cost = cost;
1469 iocg_commit_bio(ctx->iocg, wait->bio, wait->abs_cost, cost);
2517 static void calc_vtime_cost_builtin(struct bio *bio, struct ioc_gq *iocg,
2522 u64 pages = max_t(u64, bio_sectors(bio) >> IOC_SECT_TO_PAGE_SHIFT, 1);
2526 /* Can't calculate cost for empty bio */
2527 if (!bio->bi_iter.bi_size)
2530 switch (bio_op(bio)) {
2546 seek_pages = abs(bio->bi_iter.bi_sector - iocg->cursor);
2562 static u64 calc_vtime_cost(struct bio *bio, struct ioc_gq *iocg, bool is_merge)
2566 calc_vtime_cost_builtin(bio, iocg, is_merge, &cost);
2595 static void ioc_rqos_throttle(struct rq_qos *rqos, struct bio *bio)
2597 struct blkcg_gq *blkg = bio->bi_blkg;
2611 abs_cost = calc_vtime_cost(bio, iocg, false);
2618 iocg->cursor = bio_end_sector(bio);
2629 iocg_commit_bio(iocg, bio, abs_cost, cost);
2640 use_debt = bio_issue_as_root_blkg(bio) || fatal_signal_pending(current);
2654 iocg_commit_bio(iocg, bio, abs_cost, cost);
2659 * We're over budget. If @bio has to be issued regardless, remember
2679 (bio->bi_opf & REQ_SWAP) == REQ_SWAP);
2710 wait.bio = bio;
2731 struct bio *bio)
2733 struct ioc_gq *iocg = blkg_to_iocg(bio->bi_blkg);
2735 sector_t bio_end = bio_end_sector(bio);
2744 abs_cost = calc_vtime_cost(bio, iocg, true);
2762 if (rq->bio && rq->bio->bi_iocost_cost &&
2764 iocg_commit_bio(iocg, bio, abs_cost, cost);
2780 (bio->bi_opf & REQ_SWAP) == REQ_SWAP);
2782 iocg_commit_bio(iocg, bio, abs_cost, cost);
2789 static void ioc_rqos_done_bio(struct rq_qos *rqos, struct bio *bio)
2791 struct ioc_gq *iocg = blkg_to_iocg(bio->bi_blkg);
2793 if (iocg && bio->bi_iocost_cost)
2794 atomic64_add(bio->bi_iocost_cost, &iocg->done_vtime);
2916 * target bio has an iocg associated and need to test for NULL iocg.