Re: Increased memory usage with scsi-mq

2017-08-10 Thread Paolo Bonzini
On 10/08/2017 17:40, Richard W.M. Jones wrote: > OK this is looking a bit better now. > > With scsi-mq enabled: 175 disks > virtqueue_size=64: 318 disks * > virtqueue_size=16: 775 disks * > With scsi-mq disabled: 1755 disks > * = new results

Re: Increased memory usage with scsi-mq

2017-08-10 Thread Richard W.M. Jones
OK this is looking a bit better now. With scsi-mq enabled: 175 disks virtqueue_size=64: 318 disks * virtqueue_size=16: 775 disks * With scsi-mq disabled: 1755 disks * = new results I also ran the whole libguestfs test suite with

Re: Increased memory usage with scsi-mq

2017-08-10 Thread Paolo Bonzini
On 10/08/2017 16:16, Richard W.M. Jones wrote: > On Thu, Aug 10, 2017 at 02:53:58PM +0200, Paolo Bonzini wrote: >> can_queue and cmd_per_lun are different. can_queue should be set to the >> value of vq->vring.num where vq is the command virtqueue (the first one >> is okay if there's >1). >> >> If

Re: Increased memory usage with scsi-mq

2017-08-10 Thread Richard W.M. Jones
On Thu, Aug 10, 2017 at 02:53:58PM +0200, Paolo Bonzini wrote: > can_queue and cmd_per_lun are different. can_queue should be set to the > value of vq->vring.num where vq is the command virtqueue (the first one > is okay if there's >1). > > If you want to change it, you'll have to do so in QEMU.

Re: Increased memory usage with scsi-mq

2017-08-10 Thread Paolo Bonzini
On 10/08/2017 14:22, Richard W.M. Jones wrote: > On Wed, Aug 09, 2017 at 06:50:10PM +0200, Paolo Bonzini wrote: >> On 09/08/2017 18:01, Christoph Hellwig wrote: >>> On Mon, Aug 07, 2017 at 03:07:48PM +0200, Paolo Bonzini wrote: can_queue should depend on the virtqueue size, which

Re: Increased memory usage with scsi-mq

2017-08-10 Thread Richard W.M. Jones
On Wed, Aug 09, 2017 at 06:50:10PM +0200, Paolo Bonzini wrote: > On 09/08/2017 18:01, Christoph Hellwig wrote: > > On Mon, Aug 07, 2017 at 03:07:48PM +0200, Paolo Bonzini wrote: > >> can_queue should depend on the virtqueue size, which unfortunately can > >> vary for each virtio-scsi device in

Re: Increased memory usage with scsi-mq

2017-08-09 Thread Paolo Bonzini
On 09/08/2017 18:01, Christoph Hellwig wrote: > On Mon, Aug 07, 2017 at 03:07:48PM +0200, Paolo Bonzini wrote: >> 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

Re: Increased memory usage with scsi-mq

2017-08-09 Thread Christoph Hellwig
On Mon, Aug 07, 2017 at 03:07:48PM +0200, Paolo Bonzini wrote: > 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

Re: Increased memory usage with scsi-mq

2017-08-07 Thread Paolo Bonzini
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

Re: Increased memory usage with scsi-mq

2017-08-07 Thread Richard W.M. Jones
On Mon, Aug 07, 2017 at 02:11:39PM +0200, Paolo Bonzini wrote: > You could also add a module parameter to the driver, and set it to 64 on > the kernel command line (there is an example in > drivers/scsi/vmw_pvscsi.c of how to do it). [Proviso: I've not tested the performance of difference values,

Re: Increased memory usage with scsi-mq

2017-08-07 Thread Paolo Bonzini
On 05/08/2017 17:51, Richard W.M. Jones wrote: > On Sat, Aug 05, 2017 at 03:39:54PM +0200, Christoph Hellwig wrote: >> For now can you apply this testing patch to the guest kernel? >> >> diff --git a/drivers/scsi/virtio_scsi.c b/drivers/scsi/virtio_scsi.c >> index 9be211d68b15..0cbe2c882e1c 100644

Re: Increased memory usage with scsi-mq

2017-08-05 Thread Richard W.M. Jones
On Sat, Aug 05, 2017 at 03:39:54PM +0200, Christoph Hellwig wrote: > For now can you apply this testing patch to the guest kernel? > > diff --git a/drivers/scsi/virtio_scsi.c b/drivers/scsi/virtio_scsi.c > index 9be211d68b15..0cbe2c882e1c 100644 > --- a/drivers/scsi/virtio_scsi.c > +++

Re: Increased memory usage with scsi-mq

2017-08-05 Thread Christoph Hellwig
For now can you apply this testing patch to the guest kernel? diff --git a/drivers/scsi/virtio_scsi.c b/drivers/scsi/virtio_scsi.c index 9be211d68b15..0cbe2c882e1c 100644 --- a/drivers/scsi/virtio_scsi.c +++ b/drivers/scsi/virtio_scsi.c @@ -818,7 +818,7 @@ static struct scsi_host_template

Re: Increased memory usage with scsi-mq

2017-08-05 Thread Richard W.M. Jones
On Sat, Aug 05, 2017 at 10:44:36AM +0200, Christoph Hellwig wrote: > On Fri, Aug 04, 2017 at 10:00:47PM +0100, Richard W.M. Jones wrote: > > I read your slides about scsi-mq and it seems like a significant > > benefit to large machines, but could the out of the box defaults be > > made more

Re: Increased memory usage with scsi-mq

2017-08-05 Thread Christoph Hellwig
On Fri, Aug 04, 2017 at 10:00:47PM +0100, Richard W.M. Jones wrote: > I read your slides about scsi-mq and it seems like a significant > benefit to large machines, but could the out of the box defaults be > made more friendly for small memory machines? The default inumber of queues and queue