Lines Matching defs:bic
369 struct bfq_queue *bic_to_bfqq(struct bfq_io_cq *bic, bool is_sync)
371 return bic->bfqq[is_sync];
374 void bic_set_bfqq(struct bfq_io_cq *bic, struct bfq_queue *bfqq, bool is_sync)
376 struct bfq_queue *old_bfqq = bic->bfqq[is_sync];
378 /* Clear bic pointer if bfqq is detached from this bic */
379 if (old_bfqq && old_bfqq->bic == bic)
380 old_bfqq->bic = NULL;
382 bic->bfqq[is_sync] = bfqq;
385 struct bfq_data *bic_to_bfqd(struct bfq_io_cq *bic)
387 return bic->icq.q->elevator->elevator_data;
396 /* bic->icq is the first member, %NULL will convert to %NULL */
401 * bfq_bic_lookup - search into @ioc a bic associated to @bfqd.
1020 struct bfq_io_cq *bic, bool bfq_already_existing)
1025 if (bic->saved_has_short_ttime)
1030 if (bic->saved_IO_bound)
1035 bfqq->entity.new_weight = bic->saved_weight;
1036 bfqq->ttime = bic->saved_ttime;
1037 bfqq->wr_coeff = bic->saved_wr_coeff;
1038 bfqq->wr_start_at_switch_to_srt = bic->saved_wr_start_at_switch_to_srt;
1039 bfqq->last_wr_start_finish = bic->saved_last_wr_start_finish;
1040 bfqq->wr_cur_max_time = bic->saved_wr_cur_max_time;
1694 bfqq->bic && (*interactive || soft_rt)));
2229 * queue_lock inside the bfqd->lock. We assume that the bic
2233 struct bfq_io_cq *bic = bfq_bic_lookup(bfqd, current->io_context, q);
2238 if (bic) {
2243 bfq_bic_update_cgroup(bic, bio);
2245 bfqd->bio_bfqq = bic_to_bfqq(bic, op_is_sync(bio->bi_opf));
2249 bfqd->bio_bic = bic;
2549 * not available any more (new_bfqq->bic == NULL).
2720 struct bfq_io_cq *bic = bfqq->bic;
2723 * If !bfqq->bic, the queue is already shared or its requests
2727 if (!bic)
2730 bic->saved_weight = bfqq->entity.orig_weight;
2731 bic->saved_ttime = bfqq->ttime;
2732 bic->saved_has_short_ttime = bfq_bfqq_has_short_ttime(bfqq);
2733 bic->saved_IO_bound = bfq_bfqq_IO_bound(bfqq);
2734 bic->saved_in_large_burst = bfq_bfqq_in_large_burst(bfqq);
2735 bic->was_in_burst_list = !hlist_unhashed(&bfqq->burst_list_node);
2748 bic->saved_wr_coeff = bfqq->bfqd->bfq_wr_coeff;
2749 bic->saved_wr_start_at_switch_to_srt = bfq_smallest_from_now();
2750 bic->saved_wr_cur_max_time = bfq_wr_duration(bfqq->bfqd);
2751 bic->saved_last_wr_start_finish = jiffies;
2753 bic->saved_wr_coeff = bfqq->wr_coeff;
2754 bic->saved_wr_start_at_switch_to_srt =
2756 bic->saved_last_wr_start_finish = bfqq->last_wr_start_finish;
2757 bic->saved_wr_cur_max_time = bfqq->wr_cur_max_time;
2782 bfq_merge_bfqqs(struct bfq_data *bfqd, struct bfq_io_cq *bic,
2825 * Merge queues (that is, let bic redirect its requests to new_bfqq)
2827 bic_set_bfqq(bic, new_bfqq, true);
2831 * set new_bfqq->bic to NULL. bfqq either:
2832 * - does not belong to any bic any more, and hence bfqq->bic must
2836 * any bic soon and bfqq->bic is already NULL (therefore the next
2839 new_bfqq->bic = NULL;
2850 bfqq->bic = NULL;
2881 * bic still points to bfqq, then it has not yet been
2884 * fulfilled, i.e., bic can be redirected to new_bfqq
4053 /* mark bfqq as waiting a request only if a bic still points to it */
4460 bfqq->bic && bfqq->bic->bfqq[0] &&
4461 bfq_bfqq_busy(bfqq->bic->bfqq[0]) &&
4462 bfqq->bic->bfqq[0]->next_rq ?
4463 bfqq->bic->bfqq[0] : NULL;
4538 icq_to_bic(async_bfqq->next_rq->elv.icq) == bfqq->bic &&
4541 bfqq = bfqq->bic->bfqq[0];
4911 if (bfqq->bic && bfqq->bfqd->burst_size > 0)
4982 static void bfq_exit_icq_bfqq(struct bfq_io_cq *bic, bool is_sync)
4984 struct bfq_queue *bfqq = bic_to_bfqq(bic, is_sync);
4994 bic_set_bfqq(bic, NULL, is_sync);
5002 struct bfq_io_cq *bic = icq_to_bic(icq);
5004 bfq_exit_icq_bfqq(bic, true);
5005 bfq_exit_icq_bfqq(bic, false);
5013 bfq_set_next_ioprio_data(struct bfq_queue *bfqq, struct bfq_io_cq *bic)
5022 ioprio_class = IOPRIO_PRIO_CLASS(bic->ioprio);
5037 bfqq->new_ioprio = IOPRIO_PRIO_DATA(bic->ioprio);
5041 bfqq->new_ioprio = IOPRIO_PRIO_DATA(bic->ioprio);
5062 struct bfq_io_cq *bic);
5064 static void bfq_check_ioprio_change(struct bfq_io_cq *bic, struct bio *bio)
5066 struct bfq_data *bfqd = bic_to_bfqd(bic);
5068 int ioprio = bic->icq.ioc->ioprio;
5071 * This condition may trigger on a newly created bic, be sure to
5074 if (unlikely(!bfqd) || likely(bic->ioprio == ioprio))
5077 bic->ioprio = ioprio;
5079 bfqq = bic_to_bfqq(bic, false);
5083 bfqq = bfq_get_queue(bfqd, bio, false, bic);
5084 bic_set_bfqq(bic, bfqq, false);
5088 bfqq = bic_to_bfqq(bic, true);
5090 bfq_set_next_ioprio_data(bfqq, bic);
5094 struct bfq_io_cq *bic, pid_t pid, int is_sync)
5105 if (bic)
5106 bfq_set_next_ioprio_data(bfqq, bic);
5174 struct bfq_io_cq *bic)
5176 const int ioprio = IOPRIO_PRIO_DATA(bic->ioprio);
5177 const int ioprio_class = IOPRIO_PRIO_CLASS(bic->ioprio);
5196 bfq_init_bfqq(bfqd, bfqq, bic, current->pid,
5258 struct bfq_io_cq *bic)
5280 if (atomic_read(&bic->icq.ioc->active_ref) == 0 ||
5459 * If the bic associated with the process
5990 * that bic points to the bfq iocontext of the task.
5995 bfq_split_bfqq(struct bfq_io_cq *bic, struct bfq_queue *bfqq)
6006 bic_set_bfqq(bic, NULL, true);
6015 struct bfq_io_cq *bic,
6020 struct bfq_queue *bfqq = bic_to_bfqq(bic, is_sync);
6030 bfqq = bfq_get_queue(bfqd, bio, is_sync, bic);
6032 bic_set_bfqq(bic, bfqq, is_sync);
6034 if ((bic->was_in_burst_list && bfqd->large_burst) ||
6035 bic->saved_in_large_burst)
6039 if (bic->was_in_burst_list)
6088 * previously allocated bic/bfqq structs.
6121 struct bfq_io_cq *bic;
6140 bic = icq_to_bic(rq->elv.icq);
6142 bfq_check_ioprio_change(bic, bio);
6144 bfq_bic_update_cgroup(bic, bio);
6146 bfqq = bfq_get_bfqq_handle_split(bfqd, bic, bio, false, is_sync,
6154 /* Update bic before losing reference to bfqq */
6156 bic->saved_in_large_burst = true;
6158 bfqq = bfq_split_bfqq(bic, bfqq);
6162 bfqq = bfq_get_bfqq_handle_split(bfqd, bic, bio,
6175 rq->elv.priv[0] = bic;
6180 * by only this bic: we can then set bfqq->bic = bic. in
6185 bfqq->bic = bic;
6192 bfq_bfqq_resume_state(bfqq, bfqd, bic,