Lines Matching refs:hctx

138  * There is a same mapping between ctx & hctx and kcq & khd,
453 static void kyber_depth_updated(struct blk_mq_hw_ctx *hctx)
455 struct kyber_queue_data *kqd = hctx->queue->elevator->elevator_data;
456 struct blk_mq_tags *tags = hctx->sched_tags;
464 static int kyber_init_hctx(struct blk_mq_hw_ctx *hctx, unsigned int hctx_idx)
469 khd = kmalloc_node(sizeof(*khd), GFP_KERNEL, hctx->numa_node);
473 khd->kcqs = kmalloc_array_node(hctx->nr_ctx,
475 GFP_KERNEL, hctx->numa_node);
479 for (i = 0; i < hctx->nr_ctx; i++)
483 if (sbitmap_init_node(&khd->kcq_map[i], hctx->nr_ctx,
484 ilog2(8), GFP_KERNEL, hctx->numa_node,
499 khd->domain_wait[i].wait.private = hctx;
507 hctx->sched_data = khd;
508 kyber_depth_updated(hctx);
519 static void kyber_exit_hctx(struct blk_mq_hw_ctx *hctx, unsigned int hctx_idx)
521 struct kyber_hctx_data *khd = hctx->sched_data;
527 kfree(hctx->sched_data);
571 struct blk_mq_hw_ctx *hctx = blk_mq_map_queue(q, bio->bi_opf, ctx);
572 struct kyber_hctx_data *khd = hctx->sched_data;
573 struct kyber_ctx_queue *kcq = &khd->kcqs[ctx->index_hw[hctx->type]];
579 merged = blk_bio_list_merge(hctx->queue, rq_list, bio, nr_segs);
590 static void kyber_insert_requests(struct blk_mq_hw_ctx *hctx,
594 struct kyber_hctx_data *khd = hctx->sched_data;
599 struct kyber_ctx_queue *kcq = &khd->kcqs[rq->mq_ctx->index_hw[hctx->type]];
609 rq->mq_ctx->index_hw[hctx->type]);
698 struct blk_mq_hw_ctx *hctx = READ_ONCE(wqe->private);
702 blk_mq_run_hw_queue(hctx, true);
708 struct blk_mq_hw_ctx *hctx)
756 struct blk_mq_hw_ctx *hctx)
774 nr = kyber_get_domain_token(kqd, khd, hctx);
785 nr = kyber_get_domain_token(kqd, khd, hctx);
803 static struct request *kyber_dispatch_request(struct blk_mq_hw_ctx *hctx)
805 struct kyber_queue_data *kqd = hctx->queue->elevator->elevator_data;
806 struct kyber_hctx_data *khd = hctx->sched_data;
817 rq = kyber_dispatch_cur_domain(kqd, khd, hctx);
838 rq = kyber_dispatch_cur_domain(kqd, khd, hctx);
849 static bool kyber_has_work(struct blk_mq_hw_ctx *hctx)
851 struct kyber_hctx_data *khd = hctx->sched_data;
913 struct blk_mq_hw_ctx *hctx = m->private; \
914 struct kyber_hctx_data *khd = hctx->sched_data; \
923 struct blk_mq_hw_ctx *hctx = m->private; \
924 struct kyber_hctx_data *khd = hctx->sched_data; \
932 struct blk_mq_hw_ctx *hctx = m->private; \
933 struct kyber_hctx_data *khd = hctx->sched_data; \
947 struct blk_mq_hw_ctx *hctx = data; \
948 struct kyber_hctx_data *khd = hctx->sched_data; \
971 struct blk_mq_hw_ctx *hctx = data;
972 struct kyber_hctx_data *khd = hctx->sched_data;
980 struct blk_mq_hw_ctx *hctx = data;
981 struct kyber_hctx_data *khd = hctx->sched_data;