From: Paolo Bonzini <pbonzini@redhat.com>
To: "Richard W.M. Jones" <rjones@redhat.com>, jejb@linux.vnet.ibm.com
Cc: martin.petersen@oracle.com, mst@redhat.com, jasowang@redhat.com,
linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org,
virtualization@lists.linux-foundation.org, hch@lst.de
Subject: Re: [PATCH 2/2] virtio: virtio_scsi: Set can_queue to the length of the virtqueue.
Date: Thu, 10 Aug 2017 18:46:05 +0200 [thread overview]
Message-ID: <9d89d5ad-ed28-41a4-e3b9-ac96a93cf46a@redhat.com> (raw)
In-Reply-To: <20170810164035.19963-3-rjones@redhat.com>
On 10/08/2017 18:40, Richard W.M. Jones wrote:
> Since switching to blk-mq as the default in commit 5c279bd9e406
> ("scsi: default to scsi-mq"), virtio-scsi LUNs consume about 10x as
> much kernel memory.
>
> qemu currently allocates a fixed 128 entry virtqueue. can_queue
> currently is set to 1024. But with indirect descriptors, each command
> in the queue takes 1 virtqueue entry, so the number of commands which
> can be queued is equal to the length of the virtqueue.
>
> Note I intend to send a patch to qemu to allow the virtqueue size to
> be configured from the qemu command line.
You can clear .can_queue from the templates. Otherwise looks good.
Paolo
> Thanks Paolo Bonzini, Christoph Hellwig.
>
> Signed-off-by: Richard W.M. Jones <rjones@redhat.com>
> ---
> drivers/scsi/virtio_scsi.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/scsi/virtio_scsi.c b/drivers/scsi/virtio_scsi.c
> index 9be211d68b15..d6b4ff634c0d 100644
> --- a/drivers/scsi/virtio_scsi.c
> +++ b/drivers/scsi/virtio_scsi.c
> @@ -972,6 +972,8 @@ static int virtscsi_probe(struct virtio_device *vdev)
> if (err)
> goto virtscsi_init_failed;
>
> + shost->can_queue = virtqueue_get_vring_size(vscsi->req_vqs[0].vq);
> +
> cmd_per_lun = virtscsi_config_get(vdev, cmd_per_lun) ?: 1;
> shost->cmd_per_lun = min_t(u32, cmd_per_lun, shost->can_queue);
> shost->max_sectors = virtscsi_config_get(vdev, max_sectors) ?: 0xFFFF;
>
prev parent reply other threads:[~2017-08-10 16:46 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-10 16:40 [PATCH 0/2] virtio_scsi: Set can_queue based on size of virtqueue Richard W.M. Jones
2017-08-10 16:40 ` [PATCH 1/2] virtio: Reduce BUG if total_sg > virtqueue size to WARN Richard W.M. Jones
2017-08-10 16:47 ` Paolo Bonzini
2017-08-10 21:21 ` Michael S. Tsirkin
2017-08-10 21:30 ` Richard W.M. Jones
2017-08-10 21:31 ` Michael S. Tsirkin
2017-08-10 21:35 ` Richard W.M. Jones
2017-08-10 21:41 ` Michael S. Tsirkin
2017-08-10 21:50 ` Richard W.M. Jones
2017-08-11 14:09 ` Paolo Bonzini
2017-08-11 17:23 ` Michael S. Tsirkin
2017-08-11 18:36 ` Paolo Bonzini
2017-08-10 16:40 ` [PATCH 2/2] virtio: virtio_scsi: Set can_queue to the length of the virtqueue Richard W.M. Jones
2017-08-10 16:46 ` Paolo Bonzini [this message]
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=9d89d5ad-ed28-41a4-e3b9-ac96a93cf46a@redhat.com \
--to=pbonzini@redhat.com \
--cc=hch@lst.de \
--cc=jasowang@redhat.com \
--cc=jejb@linux.vnet.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=mst@redhat.com \
--cc=rjones@redhat.com \
--cc=virtualization@lists.linux-foundation.org \
/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
Powered by JetHome