mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@kernel.dk>
To: Jianchao Wang <jianchao.w.wang@oracle.com>
Cc: ming.lei@redhat.com, linux-block@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH V9 3/4] blk-mq: issue directly with bypass 'false' in blk_mq_sched_insert_requests
Date: Wed, 5 Dec 2018 09:30:44 -0700	[thread overview]
Message-ID: <6cb12913-3575-d3aa-ff08-f89bcb38b3d6@kernel.dk> (raw)
In-Reply-To: <1543995842-20704-4-git-send-email-jianchao.w.wang@oracle.com>

On 12/5/18 12:44 AM, Jianchao Wang wrote:
> diff --git a/block/blk-mq.c b/block/blk-mq.c
> index fe92e52..0dfa269 100644
> --- a/block/blk-mq.c
> +++ b/block/blk-mq.c
> @@ -1899,32 +1899,23 @@ blk_status_t blk_mq_request_issue_directly(struct request *rq, bool last)
>  void blk_mq_try_issue_list_directly(struct blk_mq_hw_ctx *hctx,
>  		struct list_head *list)
>  {
> +	blk_qc_t cookie = BLK_QC_T_INVALID;
> +

I'm fine with adding this, but I think we need some sort of check for
that not being a valid cookie. That isn't new, we really should have
already.

>  	while (!list_empty(list)) {
> -		blk_status_t ret;
>  		struct request *rq = list_first_entry(list, struct request,
>  				queuelist);
>  
> -		if (!blk_rq_can_direct_dispatch(rq))
> -			break;
> -
>  		list_del_init(&rq->queuelist);
> -		ret = blk_mq_request_issue_directly(rq, list_empty(list));
> -		if (ret != BLK_STS_OK) {
> -			if (ret == BLK_STS_RESOURCE ||
> -					ret == BLK_STS_DEV_RESOURCE) {
> -				list_add(&rq->queuelist, list);
> -				break;
> -			}
> -			blk_mq_end_request(rq, ret);
> -		}
> +		blk_mq_try_issue_directly(hctx, rq, &cookie, false,
> +				list_empty(list));

Indent the list_empty() one more tab, should be after the ( if possible.

> -	 * If we didn't flush the entire list, we could have told
> -	 * the driver there was more coming, but that turned out to
> -	 * be a lie.
> +	 * cookie is set to a valid value only when reqeust is issued successfully.
> +	 * We only need to care about the last request's result, if it is inserted,
> +	 * kick the hardware with commit_rqs hook.

reqeust -> request

Also lines are too long, limit to 80 chars please.

And why aren't we just using the list_empty() check like before, and not
having to add the inval cookie value?

> -	if (!list_empty(list) && hctx->queue->mq_ops->commit_rqs)
> +	if ((cookie == BLK_QC_T_INVALID) && hctx->queue->mq_ops->commit_rqs)
>  		hctx->queue->mq_ops->commit_rqs(hctx);

Redundant parens around the cookie check.

-- 
Jens Axboe


  reply	other threads:[~2018-12-05 16:30 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-05  7:43 [PATCH V9 0/4] blk-mq: refactor code of issue directly Jianchao Wang
2018-12-05  7:43 ` [PATCH V9 1/4] blk-mq: insert to hctx dispatch list when bypass_insert is true Jianchao Wang
2018-12-05 16:25   ` Jens Axboe
2018-12-06  1:12     ` jianchao.wang
2018-12-05  7:44 ` [PATCH V9 2/4] blk-mq: refactor the code of issue request directly Jianchao Wang
2018-12-05 16:27   ` Jens Axboe
2018-12-06  1:12     ` jianchao.wang
2018-12-05  7:44 ` [PATCH V9 3/4] blk-mq: issue directly with bypass 'false' in blk_mq_sched_insert_requests Jianchao Wang
2018-12-05 16:30   ` Jens Axboe [this message]
2018-12-06  1:11     ` jianchao.wang
2018-12-06  2:13       ` Jens Axboe
2018-12-05  7:44 ` [PATCH V9 4/4] blk-mq: replace and kill blk_mq_request_issue_directly Jianchao Wang
2018-12-05 16:30   ` Jens Axboe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6cb12913-3575-d3aa-ff08-f89bcb38b3d6@kernel.dk \
    --to=axboe@kernel.dk \
    --cc=jianchao.w.wang@oracle.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ming.lei@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®