[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <d46af0a7-62f3-4988-2b1c-857378282356@kernel.dk>
Date: Wed, 5 Dec 2018 09:27:05 -0700
From: Jens Axboe <axboe@...nel.dk>
To: Jianchao Wang <jianchao.w.wang@...cle.com>
Cc: ming.lei@...hat.com, linux-block@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH V9 2/4] blk-mq: refactor the code of issue request
directly
On 12/5/18 12:44 AM, Jianchao Wang wrote:
> Merge blk_mq_try_issue_directly and __blk_mq_try_issue_directly
> into one interface to unify the interfaces to issue requests
> directly. The merged interface takes over the requests totally,
> it could insert, end or do nothing based on the return value of
> .queue_rq and 'bypass' parameter. Then caller needn't any other
> handling any more and then code could be cleaned up.
>
> Signed-off-by: Jianchao Wang <jianchao.w.wang@...cle.com>
> ---
> block/blk-mq.c | 116 +++++++++++++++++++++++++++------------------------------
> 1 file changed, 54 insertions(+), 62 deletions(-)
>
> diff --git a/block/blk-mq.c b/block/blk-mq.c
> index 153af90..fe92e52 100644
> --- a/block/blk-mq.c
> +++ b/block/blk-mq.c
> @@ -1815,93 +1815,85 @@ static bool blk_rq_can_direct_dispatch(struct request *rq)
> return req_op(rq) == REQ_OP_READ || req_op(rq) == REQ_OP_WRITE;
> }
>
> -static blk_status_t __blk_mq_try_issue_directly(struct blk_mq_hw_ctx *hctx,
> +static blk_status_t blk_mq_try_issue_directly(struct blk_mq_hw_ctx *hctx,
> struct request *rq,
> blk_qc_t *cookie,
> - bool bypass_insert, bool last)
> + bool bypass, bool last)
> {
> struct request_queue *q = rq->q;
> bool run_queue = true;
> + blk_status_t ret = BLK_STS_RESOURCE;
> + int srcu_idx;
> bool force = false;
>
> + if (!blk_rq_can_direct_dispatch(rq)) {
> + /*
> + * Insert request to hctx dispatch list for 'bypass == true'
> + * case, otherwise, the caller will fail forever.
> + */
> + if (bypass)
> + force = true;
> + goto out;
> + }
Same here, of course.
Otherwise looks fine.
--
Jens Axboe
Powered by blists - more mailing lists