mirror of
git://git.yoctoproject.org/linux-yocto.git
synced 2025-10-22 23:13:01 +02:00
block: take rq_list instead of plug in dispatch functions
blk_mq_plug_issue_direct(), __blk_mq_flush_plug_list(), and blk_mq_dispatch_plug_list() take a struct blk_plug * but only use its mq_list. Pass the struct rq_list * instead in preparation for calling them with other lists of requests. Drop "plug" from the function names as they are no longer plug-specific. Signed-off-by: Caleb Sander Mateos <csander@purestorage.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Link: https://lore.kernel.org/r/20250426011728.4189119-2-csander@purestorage.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
parent
9e4f11c122
commit
0aeb7ebfc7
|
@ -2790,15 +2790,15 @@ static blk_status_t blk_mq_request_issue_directly(struct request *rq, bool last)
|
||||||
return __blk_mq_issue_directly(hctx, rq, last);
|
return __blk_mq_issue_directly(hctx, rq, last);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void blk_mq_plug_issue_direct(struct blk_plug *plug)
|
static void blk_mq_issue_direct(struct rq_list *rqs)
|
||||||
{
|
{
|
||||||
struct blk_mq_hw_ctx *hctx = NULL;
|
struct blk_mq_hw_ctx *hctx = NULL;
|
||||||
struct request *rq;
|
struct request *rq;
|
||||||
int queued = 0;
|
int queued = 0;
|
||||||
blk_status_t ret = BLK_STS_OK;
|
blk_status_t ret = BLK_STS_OK;
|
||||||
|
|
||||||
while ((rq = rq_list_pop(&plug->mq_list))) {
|
while ((rq = rq_list_pop(rqs))) {
|
||||||
bool last = rq_list_empty(&plug->mq_list);
|
bool last = rq_list_empty(rqs);
|
||||||
|
|
||||||
if (hctx != rq->mq_hctx) {
|
if (hctx != rq->mq_hctx) {
|
||||||
if (hctx) {
|
if (hctx) {
|
||||||
|
@ -2829,15 +2829,14 @@ out:
|
||||||
blk_mq_commit_rqs(hctx, queued, false);
|
blk_mq_commit_rqs(hctx, queued, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void __blk_mq_flush_plug_list(struct request_queue *q,
|
static void __blk_mq_flush_list(struct request_queue *q, struct rq_list *rqs)
|
||||||
struct blk_plug *plug)
|
|
||||||
{
|
{
|
||||||
if (blk_queue_quiesced(q))
|
if (blk_queue_quiesced(q))
|
||||||
return;
|
return;
|
||||||
q->mq_ops->queue_rqs(&plug->mq_list);
|
q->mq_ops->queue_rqs(rqs);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void blk_mq_dispatch_plug_list(struct blk_plug *plug, bool from_sched)
|
static void blk_mq_dispatch_list(struct rq_list *rqs, bool from_sched)
|
||||||
{
|
{
|
||||||
struct blk_mq_hw_ctx *this_hctx = NULL;
|
struct blk_mq_hw_ctx *this_hctx = NULL;
|
||||||
struct blk_mq_ctx *this_ctx = NULL;
|
struct blk_mq_ctx *this_ctx = NULL;
|
||||||
|
@ -2847,7 +2846,7 @@ static void blk_mq_dispatch_plug_list(struct blk_plug *plug, bool from_sched)
|
||||||
LIST_HEAD(list);
|
LIST_HEAD(list);
|
||||||
|
|
||||||
do {
|
do {
|
||||||
struct request *rq = rq_list_pop(&plug->mq_list);
|
struct request *rq = rq_list_pop(rqs);
|
||||||
|
|
||||||
if (!this_hctx) {
|
if (!this_hctx) {
|
||||||
this_hctx = rq->mq_hctx;
|
this_hctx = rq->mq_hctx;
|
||||||
|
@ -2860,9 +2859,9 @@ static void blk_mq_dispatch_plug_list(struct blk_plug *plug, bool from_sched)
|
||||||
}
|
}
|
||||||
list_add_tail(&rq->queuelist, &list);
|
list_add_tail(&rq->queuelist, &list);
|
||||||
depth++;
|
depth++;
|
||||||
} while (!rq_list_empty(&plug->mq_list));
|
} while (!rq_list_empty(rqs));
|
||||||
|
|
||||||
plug->mq_list = requeue_list;
|
*rqs = requeue_list;
|
||||||
trace_block_unplug(this_hctx->queue, depth, !from_sched);
|
trace_block_unplug(this_hctx->queue, depth, !from_sched);
|
||||||
|
|
||||||
percpu_ref_get(&this_hctx->queue->q_usage_counter);
|
percpu_ref_get(&this_hctx->queue->q_usage_counter);
|
||||||
|
@ -2914,19 +2913,18 @@ void blk_mq_flush_plug_list(struct blk_plug *plug, bool from_schedule)
|
||||||
*/
|
*/
|
||||||
if (q->mq_ops->queue_rqs) {
|
if (q->mq_ops->queue_rqs) {
|
||||||
blk_mq_run_dispatch_ops(q,
|
blk_mq_run_dispatch_ops(q,
|
||||||
__blk_mq_flush_plug_list(q, plug));
|
__blk_mq_flush_list(q, &plug->mq_list));
|
||||||
if (rq_list_empty(&plug->mq_list))
|
if (rq_list_empty(&plug->mq_list))
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
blk_mq_run_dispatch_ops(q,
|
blk_mq_run_dispatch_ops(q, blk_mq_issue_direct(&plug->mq_list));
|
||||||
blk_mq_plug_issue_direct(plug));
|
|
||||||
if (rq_list_empty(&plug->mq_list))
|
if (rq_list_empty(&plug->mq_list))
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
do {
|
do {
|
||||||
blk_mq_dispatch_plug_list(plug, from_schedule);
|
blk_mq_dispatch_list(&plug->mq_list, from_schedule);
|
||||||
} while (!rq_list_empty(&plug->mq_list));
|
} while (!rq_list_empty(&plug->mq_list));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -715,7 +715,7 @@ static void dd_insert_request(struct blk_mq_hw_ctx *hctx, struct request *rq,
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Called from blk_mq_insert_request() or blk_mq_dispatch_plug_list().
|
* Called from blk_mq_insert_request() or blk_mq_dispatch_list().
|
||||||
*/
|
*/
|
||||||
static void dd_insert_requests(struct blk_mq_hw_ctx *hctx,
|
static void dd_insert_requests(struct blk_mq_hw_ctx *hctx,
|
||||||
struct list_head *list,
|
struct list_head *list,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user