Lines Matching refs:hctx
138 * There is a same mapping between ctx & hctx and kcq & khd,
448 static void kyber_depth_updated(struct blk_mq_hw_ctx *hctx)
450 struct kyber_queue_data *kqd = hctx->queue->elevator->elevator_data;
451 struct blk_mq_tags *tags = hctx->sched_tags;
459 static int kyber_init_hctx(struct blk_mq_hw_ctx *hctx, unsigned int hctx_idx)
464 khd = kmalloc_node(sizeof(*khd), GFP_KERNEL, hctx->numa_node);
468 khd->kcqs = kmalloc_array_node(hctx->nr_ctx,
470 GFP_KERNEL, hctx->numa_node);
474 for (i = 0; i < hctx->nr_ctx; i++)
478 if (sbitmap_init_node(&khd->kcq_map[i], hctx->nr_ctx,
479 ilog2(8), GFP_KERNEL, hctx->numa_node)) {
493 khd->domain_wait[i].wait.private = hctx;
501 hctx->sched_data = khd;
502 kyber_depth_updated(hctx);
513 static void kyber_exit_hctx(struct blk_mq_hw_ctx *hctx, unsigned int hctx_idx)
515 struct kyber_hctx_data *khd = hctx->sched_data;
521 kfree(hctx->sched_data);
565 struct blk_mq_hw_ctx *hctx = blk_mq_map_queue(q, bio->bi_opf, ctx);
566 struct kyber_hctx_data *khd = hctx->sched_data;
567 struct kyber_ctx_queue *kcq = &khd->kcqs[ctx->index_hw[hctx->type]];
573 merged = blk_bio_list_merge(hctx->queue, rq_list, bio, nr_segs);
584 static void kyber_insert_requests(struct blk_mq_hw_ctx *hctx,
587 struct kyber_hctx_data *khd = hctx->sched_data;
592 struct kyber_ctx_queue *kcq = &khd->kcqs[rq->mq_ctx->index_hw[hctx->type]];
601 rq->mq_ctx->index_hw[hctx->type]);
691 struct blk_mq_hw_ctx *hctx = READ_ONCE(wqe->private);
695 blk_mq_run_hw_queue(hctx, true);
701 struct blk_mq_hw_ctx *hctx)
749 struct blk_mq_hw_ctx *hctx)
767 nr = kyber_get_domain_token(kqd, khd, hctx);
778 nr = kyber_get_domain_token(kqd, khd, hctx);
796 static struct request *kyber_dispatch_request(struct blk_mq_hw_ctx *hctx)
798 struct kyber_queue_data *kqd = hctx->queue->elevator->elevator_data;
799 struct kyber_hctx_data *khd = hctx->sched_data;
810 rq = kyber_dispatch_cur_domain(kqd, khd, hctx);
831 rq = kyber_dispatch_cur_domain(kqd, khd, hctx);
842 static bool kyber_has_work(struct blk_mq_hw_ctx *hctx)
844 struct kyber_hctx_data *khd = hctx->sched_data;
906 struct blk_mq_hw_ctx *hctx = m->private; \
907 struct kyber_hctx_data *khd = hctx->sched_data; \
916 struct blk_mq_hw_ctx *hctx = m->private; \
917 struct kyber_hctx_data *khd = hctx->sched_data; \
925 struct blk_mq_hw_ctx *hctx = m->private; \
926 struct kyber_hctx_data *khd = hctx->sched_data; \
940 struct blk_mq_hw_ctx *hctx = data; \
941 struct kyber_hctx_data *khd = hctx->sched_data; \
964 struct blk_mq_hw_ctx *hctx = data;
965 struct kyber_hctx_data *khd = hctx->sched_data;
973 struct blk_mq_hw_ctx *hctx = data;
974 struct kyber_hctx_data *khd = hctx->sched_data;