mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "jianchao.wang" <jianchao.w.wang@oracle.com>
To: Jens Axboe <axboe@kernel.dk>
Cc: ming.lei@redhat.com, linux-block@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH V9 2/4] blk-mq: refactor the code of issue request directly
Date: Thu, 6 Dec 2018 09:12:33 +0800	[thread overview]
Message-ID: <f1f368b7-fb2f-5ef4-4179-6086a0d91c35@oracle.com> (raw)
In-Reply-To: <d46af0a7-62f3-4988-2b1c-857378282356@kernel.dk>



On 12/6/18 12:27 AM, Jens Axboe wrote:
> 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@oracle.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.

Yes, I will change it next version.

> 
> Otherwise looks fine.
> 

Thanks
Jianchao

  reply	other threads:[~2018-12-06  1:12 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 [this message]
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
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=f1f368b7-fb2f-5ef4-4179-6086a0d91c35@oracle.com \
    --to=jianchao.w.wang@oracle.com \
    --cc=axboe@kernel.dk \
    --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®