[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ffc29e81-ff6b-7132-2e90-86b5632098fb@redhat.com>
Date: Mon, 7 Aug 2017 15:07:48 +0200
From: Paolo Bonzini <pbonzini@...hat.com>
To: "Richard W.M. Jones" <rjones@...hat.com>
Cc: Christoph Hellwig <hch@....de>, linux-scsi@...r.kernel.org,
linux-kernel@...r.kernel.org,
"Martin K. Petersen" <martin.petersen@...cle.com>
Subject: Re: Increased memory usage with scsi-mq
On 07/08/2017 14:27, Richard W.M. Jones wrote:
> Also I noticed this code in virtio_scsi.c:
>
> cmd_per_lun = virtscsi_config_get(vdev, cmd_per_lun) ?: 1;
> shost->cmd_per_lun = min_t(u32, cmd_per_lun, shost->can_queue);
>
> but setting cmd_per_lun (as a qemu virtio-scsi-pci parameter) didn't
> seem to make any difference to memory usage.
That's because memory depends on shost->can_queue, not
shost->cmd_per_lun (see scsi_mq_setup_tags).
can_queue should depend on the virtqueue size, which unfortunately can
vary for each virtio-scsi device in theory. The virtqueue size is
retrieved by drivers/virtio prior to calling vring_create_virtqueue, and
in QEMU it is the second argument to virtio_add_queue.
For virtio-scsi this is VIRTIO_SCSI_VQ_SIZE, which is 128, so changing
can_queue to 128 should be a no brainer.
Thanks,
Paolo
Powered by blists - more mailing lists