mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: "Richard W.M. Jones" <rjones@redhat.com>
Cc: Christoph Hellwig <hch@lst.de>,
	linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org,
	"Martin K. Petersen" <martin.petersen@oracle.com>
Subject: Re: Increased memory usage with scsi-mq
Date: Mon, 7 Aug 2017 15:07:48 +0200	[thread overview]
Message-ID: <ffc29e81-ff6b-7132-2e90-86b5632098fb@redhat.com> (raw)
In-Reply-To: <20170807122701.GH20914@redhat.com>

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

  reply	other threads:[~2017-08-07 13:07 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-04 21:00 Richard W.M. Jones
2017-08-05  8:44 ` Christoph Hellwig
2017-08-05  9:27   ` Richard W.M. Jones
2017-08-05 13:39     ` Christoph Hellwig
2017-08-05 15:51       ` Richard W.M. Jones
2017-08-07 12:11         ` Paolo Bonzini
2017-08-07 12:27           ` Richard W.M. Jones
2017-08-07 13:07             ` Paolo Bonzini [this message]
2017-08-09 16:01               ` Christoph Hellwig
2017-08-09 16:50                 ` Paolo Bonzini
2017-08-10 12:22                   ` Richard W.M. Jones
2017-08-10 12:53                     ` Paolo Bonzini
2017-08-10 14:16                       ` Richard W.M. Jones
2017-08-10 14:30                         ` Paolo Bonzini
2017-08-10 15:40                           ` Richard W.M. Jones
2017-08-10 16:04                             ` Paolo Bonzini

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=ffc29e81-ff6b-7132-2e90-86b5632098fb@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=hch@lst.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=rjones@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

all inboxes | Powered by JetHome®