Re: [PATCH 1/2] scsi_host: add support for request batching

2019-07-05 Thread Hannes Reinecke
On 7/5/19 9:44 AM, Stefan Hajnoczi wrote: > On Fri, Jul 05, 2019 at 09:12:37AM +0200, Hannes Reinecke wrote: >> On 7/4/19 3:19 PM, Paolo Bonzini wrote: >>> On 19/06/19 12:31, Paolo Bonzini wrote: > I'm a bit unsure if 'bd->last' is always set; it's quite obvious that > it's present if set,

Re: [PATCH 1/2] scsi_host: add support for request batching

2019-07-05 Thread Stefan Hajnoczi
On Fri, Jul 05, 2019 at 09:12:37AM +0200, Hannes Reinecke wrote: > On 7/4/19 3:19 PM, Paolo Bonzini wrote: > > On 19/06/19 12:31, Paolo Bonzini wrote: > >>> I'm a bit unsure if 'bd->last' is always set; it's quite obvious that > >>> it's present if set, but what about requests with 'bd->last == fal

Re: [PATCH 1/2] scsi_host: add support for request batching

2019-07-05 Thread Hannes Reinecke
On 7/4/19 3:19 PM, Paolo Bonzini wrote: > On 19/06/19 12:31, Paolo Bonzini wrote: >>> I'm a bit unsure if 'bd->last' is always set; it's quite obvious that >>> it's present if set, but what about requests with 'bd->last == false' ? >>> Is there a guarantee that they will _always_ be followed with a

Re: [PATCH 1/2] scsi_host: add support for request batching

2019-07-04 Thread Ming Lei
On Mon, Jun 3, 2019 at 4:16 PM Paolo Bonzini wrote: > > On 31/05/19 05:27, Ming Lei wrote: > > It should be fine to implement scsi_commit_rqs() as: > > > > if (shost->hostt->commit_rqs) > >shost->hostt->commit_rqs(shost, hctx->queue_num); > > > > then scsi_mq_ops_no_commit can be saved. >

Re: [PATCH 1/2] scsi_host: add support for request batching

2019-07-04 Thread Paolo Bonzini
On 19/06/19 12:31, Paolo Bonzini wrote: >> I'm a bit unsure if 'bd->last' is always set; it's quite obvious that >> it's present if set, but what about requests with 'bd->last == false' ? >> Is there a guarantee that they will _always_ be followed with a request >> with bd->last == true? >> And if

Re: [PATCH 1/2] scsi_host: add support for request batching

2019-06-19 Thread Paolo Bonzini
On 19/06/19 10:11, Hannes Reinecke wrote: > On 5/30/19 1:28 PM, Paolo Bonzini wrote: >> This allows a list of requests to be issued, with the LLD only writing >> the hardware doorbell when necessary, after the last request was prepared. >> This is more efficient if we have lists of requests to issu

Re: [PATCH 1/2] scsi_host: add support for request batching

2019-06-19 Thread Hannes Reinecke
On 5/30/19 1:28 PM, Paolo Bonzini wrote: > This allows a list of requests to be issued, with the LLD only writing > the hardware doorbell when necessary, after the last request was prepared. > This is more efficient if we have lists of requests to issue, particularly > on virtualized hardware, wher

Re: [PATCH 1/2] scsi_host: add support for request batching

2019-06-04 Thread Bart Van Assche
On 5/30/19 4:28 AM, Paolo Bonzini wrote: This allows a list of requests to be issued, with the LLD only writing the hardware doorbell when necessary, after the last request was prepared. This is more efficient if we have lists of requests to issue, particularly on virtualized hardware, where writ

Re: [PATCH 1/2] scsi_host: add support for request batching

2019-06-03 Thread Paolo Bonzini
On 31/05/19 05:27, Ming Lei wrote: > It should be fine to implement scsi_commit_rqs() as: > > if (shost->hostt->commit_rqs) >shost->hostt->commit_rqs(shost, hctx->queue_num); > > then scsi_mq_ops_no_commit can be saved. > > Because .commit_rqs() is only called when BLK_STS_*_RESOURCE is

Re: [PATCH 1/2] scsi_host: add support for request batching

2019-05-31 Thread Paolo Bonzini
On 30/05/19 19:54, Bart Van Assche wrote: > As far as I can see the only impact of defining an empty commit_rqs > callback on the queueing behavior is that blk_mq_make_request() will > queue requests for multiple hwqs on the plug list instead of requests > for a single hwq. The plug list is sorted

Re: [PATCH 1/2] scsi_host: add support for request batching

2019-05-30 Thread Ming Lei
On Thu, May 30, 2019 at 7:28 PM Paolo Bonzini wrote: > > This allows a list of requests to be issued, with the LLD only writing > the hardware doorbell when necessary, after the last request was prepared. > This is more efficient if we have lists of requests to issue, particularly > on virtualized

Re: [PATCH 1/2] scsi_host: add support for request batching

2019-05-30 Thread Bart Van Assche
On 5/30/19 8:54 AM, Paolo Bonzini wrote: > On 30/05/19 17:36, Bart Van Assche wrote: >> On 5/30/19 4:28 AM, Paolo Bonzini wrote: >>> +static const struct blk_mq_ops scsi_mq_ops_no_commit = { >>> +    .get_budget    = scsi_mq_get_budget, >>> +    .put_budget    = scsi_mq_put_budget, >>> +    .queue_

Re: [PATCH 1/2] scsi_host: add support for request batching

2019-05-30 Thread Paolo Bonzini
On 30/05/19 17:36, Bart Van Assche wrote: > On 5/30/19 4:28 AM, Paolo Bonzini wrote: >> +static const struct blk_mq_ops scsi_mq_ops_no_commit = { >> +    .get_budget    = scsi_mq_get_budget, >> +    .put_budget    = scsi_mq_put_budget, >> +    .queue_rq    = scsi_queue_rq, >> +    .complete    = sc

Re: [PATCH 1/2] scsi_host: add support for request batching

2019-05-30 Thread Bart Van Assche
On 5/30/19 4:28 AM, Paolo Bonzini wrote: +static const struct blk_mq_ops scsi_mq_ops_no_commit = { + .get_budget = scsi_mq_get_budget, + .put_budget = scsi_mq_put_budget, + .queue_rq = scsi_queue_rq, + .complete = scsi_softirq_done, + .timeout

[PATCH 1/2] scsi_host: add support for request batching

2019-05-30 Thread Paolo Bonzini
This allows a list of requests to be issued, with the LLD only writing the hardware doorbell when necessary, after the last request was prepared. This is more efficient if we have lists of requests to issue, particularly on virtualized hardware, where writing the doorbell is more expensive than on