kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: dgilbert@interlog.com, linux-kernel@vger.kernel.org, kvm@vger.kernel.org
Cc: jejb@linux.ibm.com, martin.petersen@oracle.com,
	linux-scsi@vger.kernel.org, stefanha@redhat.com
Subject: Re: [PATCH 0/2] scsi: add support for request batching
Date: Wed, 26 Jun 2019 16:50:52 +0200	[thread overview]
Message-ID: <cbb24317-7682-a854-4460-e8828db1eb25@redhat.com> (raw)
In-Reply-To: <65e5ad25-a475-989a-ce3d-400a8c90cb61@interlog.com>

On 26/06/19 16:14, Douglas Gilbert wrote:
> 
> I have no objections, just a few questions.
> 
> To implement this is the scsi_debug driver, a per device queue would
> need to be added, correct?

Yes, queuecommand would then return before calling schedule_resp (for
all requests except the one with SCMD_LAST, see later).  schedule_resp
would then be called for all requests in a batch.

> Then a 'commit_rqs' call would be expected
> at some later point and it would drain that queue and submit each
> command. Or is the queue draining ongoing in the LLD and 'commit_rqs'
> means: don't return until that queue is empty?

commit_rqs means the former; it is asynchronous.

However, commit_rqs is only called if a request batch fails submission
in the middle of the batch, so the request batch must be sent to the
HBA.  If the whole request batch is sent successfully, then the LLD
takes care of sending the batch to the HBA when it sees SCMD_LAST in the
request.

So, in the scsi_debug case schedule_resp would be called for the whole
batch from commit_rqs *and* when queuecommand sees a command with the
SCMD_LAST flag set.  This is exactly to avoid having two calls to the
LLD in the case of no request batching.

> So does that mean in the normal (i.e. non request batching) case
> there are two calls to the LLD for each submitted command? Or is
> 'commit_rqs' optional, a sync-ing type command?

It's not syncing.  It's mandatory if the queuecommand function observes
SCMD_LAST, not needed at all if queuecommand ignores it.  So it's not
needed at all until your driver adds support for batched submission of
requests to the HBA.

(All this is documented by the patches in the comments for struct
scsi_host_template, if those are not clear please reply to patch 1 with
your doubts).

Paolo

  reply	other threads:[~2019-06-26 14:51 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-30 11:28 [PATCH 0/2] scsi: add support for request batching Paolo Bonzini
2019-05-30 11:28 ` [PATCH 1/2] scsi_host: " Paolo Bonzini
2019-05-30 15:36   ` Bart Van Assche
2019-05-30 15:54     ` Paolo Bonzini
2019-05-30 17:54       ` Bart Van Assche
2019-05-31  9:12         ` Paolo Bonzini
2019-05-31  3:27   ` Ming Lei
2019-06-03  8:16     ` Paolo Bonzini
2019-07-05  1:00       ` Ming Lei
2019-06-04 22:40   ` Bart Van Assche
2019-06-19  8:11   ` Hannes Reinecke
2019-06-19 10:31     ` Paolo Bonzini
2019-07-04 13:19       ` Paolo Bonzini
2019-07-05  7:12         ` Hannes Reinecke
2019-07-05  7:44           ` Stefan Hajnoczi
2019-07-05  7:51             ` Hannes Reinecke
2019-05-30 11:28 ` [PATCH 2/2] virtio_scsi: implement " Paolo Bonzini
2019-05-30 17:28   ` Bart Van Assche
2019-05-31  9:03     ` Paolo Bonzini
2019-07-05  7:52   ` Hannes Reinecke
2019-07-08  9:47   ` Ming Lei
2019-06-10 12:36 ` [PATCH 0/2] scsi: add support for " Stefan Hajnoczi
2019-06-26 13:51 ` Paolo Bonzini
2019-06-26 14:14   ` Douglas Gilbert
2019-06-26 14:50     ` Paolo Bonzini [this message]
2019-06-27  3:37   ` Martin K. Petersen
2019-06-27  8:17     ` Paolo Bonzini
2019-07-05  7:13       ` Hannes Reinecke
2019-07-05 11:58         ` Paolo Bonzini
2019-07-12  1:37           ` Martin K. Petersen

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=cbb24317-7682-a854-4460-e8828db1eb25@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=dgilbert@interlog.com \
    --cc=jejb@linux.ibm.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=stefanha@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;
as well as URLs for NNTP newsgroup(s).