Re: [PATCH V2] scsi: core: use blk_mq_requeue_request in __scsi_queue_insert

2018-03-01 Thread jianchao.wang
Hi martin On 03/02/2018 09:44 AM, Martin K. Petersen wrote: >> In scsi core, __scsi_queue_insert should just put request back on the >> queue and retry using the same command as before. However, for blk-mq, >> scsi_mq_requeue_cmd is employed here which will unprepare the >> request. To align with

Re: [PATCH V2] scsi: core: use blk_mq_requeue_request in __scsi_queue_insert

2018-03-01 Thread jianchao.wang
Hi martin On 03/02/2018 09:44 AM, Martin K. Petersen wrote: >> In scsi core, __scsi_queue_insert should just put request back on the >> queue and retry using the same command as before. However, for blk-mq, >> scsi_mq_requeue_cmd is employed here which will unprepare the >> request. To align with

Re: [PATCH V2] scsi: core: use blk_mq_requeue_request in __scsi_queue_insert

2018-03-01 Thread jianchao.wang
Hi martin Thanks for your kindly response. On 03/02/2018 09:43 AM, Martin K. Petersen wrote: > > Jianchao, > >> Yes, the block layer core guarantees that scsi_mq_get_budget() will be >> called before scsi_queue_rq(). I think the full picture is as follows: > >> * Before scsi_queue_rq() calls

Re: [PATCH V2] scsi: core: use blk_mq_requeue_request in __scsi_queue_insert

2018-03-01 Thread jianchao.wang
Hi martin Thanks for your kindly response. On 03/02/2018 09:43 AM, Martin K. Petersen wrote: > > Jianchao, > >> Yes, the block layer core guarantees that scsi_mq_get_budget() will be >> called before scsi_queue_rq(). I think the full picture is as follows: > >> * Before scsi_queue_rq() calls

Re: [PATCH V2] scsi: core: use blk_mq_requeue_request in __scsi_queue_insert

2018-03-01 Thread jianchao.wang
Hi Bart Thanks for your precious time and detailed summary. On 03/02/2018 01:43 AM, Bart Van Assche wrote: > Yes, the block layer core guarantees that scsi_mq_get_budget() will be called > before scsi_queue_rq(). I think the full picture is as follows: > * Before scsi_queue_rq() calls

Re: [PATCH V2] scsi: core: use blk_mq_requeue_request in __scsi_queue_insert

2018-03-01 Thread jianchao.wang
Hi Bart Thanks for your precious time and detailed summary. On 03/02/2018 01:43 AM, Bart Van Assche wrote: > Yes, the block layer core guarantees that scsi_mq_get_budget() will be called > before scsi_queue_rq(). I think the full picture is as follows: > * Before scsi_queue_rq() calls

Re: [PATCH V2] scsi: core: use blk_mq_requeue_request in __scsi_queue_insert

2018-03-01 Thread Martin K. Petersen
Jianchao, > Yes, the block layer core guarantees that scsi_mq_get_budget() will be > called before scsi_queue_rq(). I think the full picture is as follows: > * Before scsi_queue_rq() calls .queuecommand(), get_device() is called for the > SCSI device and the device, target and host busy

Re: [PATCH V2] scsi: core: use blk_mq_requeue_request in __scsi_queue_insert

2018-03-01 Thread Martin K. Petersen
Jianchao, > Yes, the block layer core guarantees that scsi_mq_get_budget() will be > called before scsi_queue_rq(). I think the full picture is as follows: > * Before scsi_queue_rq() calls .queuecommand(), get_device() is called for the > SCSI device and the device, target and host busy

Re: [PATCH V2] scsi: core: use blk_mq_requeue_request in __scsi_queue_insert

2018-03-01 Thread Martin K. Petersen
Jianchao, > In scsi core, __scsi_queue_insert should just put request back on the > queue and retry using the same command as before. However, for blk-mq, > scsi_mq_requeue_cmd is employed here which will unprepare the > request. To align with the semantics of __scsi_queue_insert, use >

Re: [PATCH V2] scsi: core: use blk_mq_requeue_request in __scsi_queue_insert

2018-03-01 Thread Martin K. Petersen
Jianchao, > In scsi core, __scsi_queue_insert should just put request back on the > queue and retry using the same command as before. However, for blk-mq, > scsi_mq_requeue_cmd is employed here which will unprepare the > request. To align with the semantics of __scsi_queue_insert, use >

Re: [PATCH V2] scsi: core: use blk_mq_requeue_request in __scsi_queue_insert

2018-03-01 Thread Bart Van Assche
On Thu, 2018-03-01 at 09:57 +0800, jianchao.wang wrote: > On 03/01/2018 01:52 AM, Bart Van Assche wrote: > > On Wed, 2018-02-28 at 16:55 +0800, Jianchao Wang wrote: > > > diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c > > > index a86df9c..6fa7b0c 100644 > > > ---

Re: [PATCH V2] scsi: core: use blk_mq_requeue_request in __scsi_queue_insert

2018-03-01 Thread Bart Van Assche
On Thu, 2018-03-01 at 09:57 +0800, jianchao.wang wrote: > On 03/01/2018 01:52 AM, Bart Van Assche wrote: > > On Wed, 2018-02-28 at 16:55 +0800, Jianchao Wang wrote: > > > diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c > > > index a86df9c..6fa7b0c 100644 > > > ---

Re: [PATCH V2] scsi: core: use blk_mq_requeue_request in __scsi_queue_insert

2018-02-28 Thread jianchao.wang
Hi Bart Thanks for your precious time to review this and kindly detailed response. On 03/01/2018 01:52 AM, Bart Van Assche wrote: > On Wed, 2018-02-28 at 16:55 +0800, Jianchao Wang wrote: >> diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c >> index a86df9c..6fa7b0c 100644 >> ---

Re: [PATCH V2] scsi: core: use blk_mq_requeue_request in __scsi_queue_insert

2018-02-28 Thread jianchao.wang
Hi Bart Thanks for your precious time to review this and kindly detailed response. On 03/01/2018 01:52 AM, Bart Van Assche wrote: > On Wed, 2018-02-28 at 16:55 +0800, Jianchao Wang wrote: >> diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c >> index a86df9c..6fa7b0c 100644 >> ---

Re: [PATCH V2] scsi: core: use blk_mq_requeue_request in __scsi_queue_insert

2018-02-28 Thread Bart Van Assche
On Wed, 2018-02-28 at 16:55 +0800, Jianchao Wang wrote: > diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c > index a86df9c..6fa7b0c 100644 > --- a/drivers/scsi/scsi_lib.c > +++ b/drivers/scsi/scsi_lib.c > @@ -191,7 +191,8 @@ static void __scsi_queue_insert(struct scsi_cmnd *cmd, >

Re: [PATCH V2] scsi: core: use blk_mq_requeue_request in __scsi_queue_insert

2018-02-28 Thread Bart Van Assche
On Wed, 2018-02-28 at 16:55 +0800, Jianchao Wang wrote: > diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c > index a86df9c..6fa7b0c 100644 > --- a/drivers/scsi/scsi_lib.c > +++ b/drivers/scsi/scsi_lib.c > @@ -191,7 +191,8 @@ static void __scsi_queue_insert(struct scsi_cmnd *cmd, >

[PATCH V2] scsi: core: use blk_mq_requeue_request in __scsi_queue_insert

2018-02-28 Thread Jianchao Wang
In scsi core, __scsi_queue_insert should just put request back on the queue and retry using the same command as before. However, for blk-mq, scsi_mq_requeue_cmd is employed here which will unprepare the request. To align with the semantics of __scsi_queue_insert, use blk_mq_requeue_request with

[PATCH V2] scsi: core: use blk_mq_requeue_request in __scsi_queue_insert

2018-02-28 Thread Jianchao Wang
In scsi core, __scsi_queue_insert should just put request back on the queue and retry using the same command as before. However, for blk-mq, scsi_mq_requeue_cmd is employed here which will unprepare the request. To align with the semantics of __scsi_queue_insert, use blk_mq_requeue_request with