[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20171003085850.GA21184@infradead.org>
Date: Tue, 3 Oct 2017 01:58:50 -0700
From: Christoph Hellwig <hch@...radead.org>
To: Ming Lei <ming.lei@...hat.com>
Cc: Jens Axboe <axboe@...com>, linux-block@...r.kernel.org,
Christoph Hellwig <hch@...radead.org>,
Mike Snitzer <snitzer@...hat.com>, dm-devel@...hat.com,
Bart Van Assche <bart.vanassche@...disk.com>,
Laurence Oberman <loberman@...hat.com>,
Paolo Valente <paolo.valente@...aro.org>,
Oleksandr Natalenko <oleksandr@...alenko.name>,
Tom Nguyen <tom81094@...il.com>, linux-kernel@...r.kernel.org,
linux-scsi@...r.kernel.org, Omar Sandoval <osandov@...com>
Subject: Re: [PATCH V5 1/7] blk-mq: issue rq directly in
blk_mq_request_bypass_insert()
This patch does two many things at once and needs a split. I also
don't really understand why it's in this series and not your dm-mpath
performance one.
> +static void blk_mq_request_direct_insert(struct blk_mq_hw_ctx *hctx,
> + struct request *rq)
> +{
> + spin_lock(&hctx->lock);
> + list_add_tail(&rq->queuelist, &hctx->dispatch);
> + spin_unlock(&hctx->lock);
> +
> + blk_mq_run_hw_queue(hctx, false);
> +}
Why doesn't this share code with blk_mq_sched_bypass_insert?
> /*
> * Should only be used carefully, when the caller knows we want to
> * bypass a potential IO scheduler on the target device.
> */
> -void blk_mq_request_bypass_insert(struct request *rq)
> +blk_status_t blk_mq_request_bypass_insert(struct request *rq)
> {
> struct blk_mq_ctx *ctx = rq->mq_ctx;
> struct blk_mq_hw_ctx *hctx = blk_mq_map_queue(rq->q, ctx->cpu);
> + blk_qc_t cookie;
> + blk_status_t ret;
>
> - spin_lock(&hctx->lock);
> - list_add_tail(&rq->queuelist, &hctx->dispatch);
> - spin_unlock(&hctx->lock);
> -
> - blk_mq_run_hw_queue(hctx, false);
> + ret = blk_mq_try_issue_directly(hctx, rq, &cookie, true);
> + if (ret == BLK_STS_RESOURCE)
> + blk_mq_request_direct_insert(hctx, rq);
> + return ret;
If you actually insert the request on BLK_STS_RESOURCE why do you
pass the error on? In general BLK_STS_RESOURCE indicates a failure
to issue.
> +/*
> + * 'dispatch_only' means we only try to dispatch it out, and
> + * don't deal with dispatch failure if BLK_STS_RESOURCE or
> + * BLK_STS_IOERR happens.
> + */
> +static blk_status_t __blk_mq_try_issue_directly(struct blk_mq_hw_ctx *hctx,
> + struct request *rq, blk_qc_t *cookie, bool may_sleep,
> + bool dispatch_only)
This dispatch_only argument that completely changes behavior is a
nightmare. Try to find a way to have a low-level helper that
always behaves as if dispatch_only is set, and then build another
helper that actually issues/completes around it.
Powered by blists - more mailing lists