From: Cornelia Huck <cohuck@redhat.com>
To: Christian Borntraeger <borntraeger@de.ibm.com>
Cc: Thomas Huth <thuth@redhat.com>,
David Hildenbrand <david@redhat.com>,
"Michael S. Tsirkin" <mst@redhat.com>,
qemu-devel@nongnu.org, Halil Pasic <pasic@linux.ibm.com>,
qemu-s390x@nongnu.org, Michael Mueller <mimu@linux.ibm.com>
Subject: Re: [PATCH 1/1] virtio-blk-ccw: tweak the default for num_queues
Date: Tue, 15 Dec 2020 09:26:56 +0100 [thread overview]
Message-ID: <20201215092656.1b95e030.cohuck@redhat.com> (raw)
In-Reply-To: <f8c4f54b-3439-1c35-2b2e-c9dae0f5241c@de.ibm.com>
On Tue, 10 Nov 2020 14:18:39 +0100
Christian Borntraeger <borntraeger@de.ibm.com> wrote:
> On 10.11.20 11:40, Halil Pasic wrote:
> > On Tue, 10 Nov 2020 09:47:51 +0100
> > Christian Borntraeger <borntraeger@de.ibm.com> wrote:
> >
> >>
> >>
> >> On 09.11.20 19:53, Halil Pasic wrote:
> >>> On Mon, 9 Nov 2020 17:06:16 +0100
> >>> Cornelia Huck <cohuck@redhat.com> wrote:
> >>>
> >>>>> @@ -20,6 +21,11 @@ static void virtio_ccw_blk_realize(VirtioCcwDevice *ccw_dev, Error **errp)
> >>>>> {
> >>>>> VirtIOBlkCcw *dev = VIRTIO_BLK_CCW(ccw_dev);
> >>>>> DeviceState *vdev = DEVICE(&dev->vdev);
> >>>>> + VirtIOBlkConf *conf = &dev->vdev.conf;
> >>>>> +
> >>>>> + if (conf->num_queues == VIRTIO_BLK_AUTO_NUM_QUEUES) {
> >>>>> + conf->num_queues = MIN(4, current_machine->smp.cpus);
> >>>>> + }
> >>>>
> >>>> I would like to have a comment explaining the numbers here, however.
> >>>>
> >>>> virtio-pci has a pretty good explanation (use 1:1 for vqs:vcpus if
> >>>> possible, apply some other capping). 4 seems to be a bit arbitrary
> >>>> without explanation, although I'm sure you did some measurements :)
> >>>
> >>> Frankly, I don't have any measurements yet. For the secure case,
> >>> I think Mimu has assessed the impact of multiqueue, hence adding Mimu to
> >>> the cc list. @Mimu can you help us out.
> >>>
> >>> Regarding the normal non-protected VMs I'm in a middle of producing some
> >>> measurement data. This was admittedly a bit rushed because of where we
> >>> are in the cycle. Sorry to disappoint you.
> >>>
> >>> The number 4 was suggested by Christian, maybe Christian does have some
> >>> readily available measurement data for the normal VM case. @Christian:
> >>> can you help me out?
> >> My point was to find a balance between performance gain and memory usage.
> >> As a matter of fact, virtqueue do consume memory. So 4 looked like a
> >> reasonable default for me for large guests as long as we do not have directed
> >> interrupts.
> >>
> >> Now, thinking about this again: If we want to change the default to something
> >> else in the future (e.g. to num vcpus) then the compat handling will get
> >> really complicated.
> >
> > Regarding compat handling, I believe we would need a new property for
> > virtio-blk-ccw: something like def_num_queues_max. Then logic would
> > morph to MIN(def_num_queues_max, current_machine->smp.cpus), and we could
> > relatively freely do compat stuff on def_num_queues_max.
> >
> > IMHO not pretty but certainly doable.
> >
> >>
> >> So we can
> >> - go with num queues = num cpus. But this will consume memory
> >> for guests with lots of CPUs.
> >
> > In absence of data that showcases the benefit outweighing the obvious
> > detriment, I lean towards finding this option the least favorable.
> >
> >> - go with the proposed logic of min(4,vcpus) and accept that future compat handling
> >> is harder
> >
> > IMHO not a bad option, but I think I would still feel better about a
> > more informed decision. In the end, the end user can already specify the
> > num_queues explicitly, so I don't think this is urgent.
> >
> >> - defer this change
> >
> > So I tend to lean towards deferring.
>
> Yes, I was pushing this for 5.2 to avoid compat handling. But maybe it is better
> to wait and do it later. But we should certainly continue the discussion to have
> something for the next release.
<going through older mails>
Do we have a better idea now about which values would make sense here?
>
> >
> > Another thought is, provided the load is about evenly spread on the
> > different virtqueues, if the game is about vCPU locality, one could
> > think of decreasing the size of each individual virtqueue while
> > increasing their number, with the idea of not paying much more in terms
> > of memory. The queue size however needs to be a power of 2,
> > so there is a limit on the granularity.
> >
> > Regarding secure VMs, currently we have to cramp at least the swiotlb and
> > the virtqueues into ZONE_DMA. So increasing the number of
> > virtqueues heavily may get us into new trouble with exotic configs.
> >
> > Regards,
> > Halil
> >
>
next prev parent reply other threads:[~2020-12-15 8:30 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-09 15:48 [PATCH 1/1] virtio-blk-ccw: tweak the default for num_queues Halil Pasic
2020-11-09 15:53 ` Christian Borntraeger
2020-11-09 16:06 ` Cornelia Huck
2020-11-09 18:53 ` Halil Pasic
2020-11-10 8:47 ` Christian Borntraeger
2020-11-10 10:15 ` Cornelia Huck
2020-11-10 10:40 ` Halil Pasic
2020-11-10 13:18 ` Christian Borntraeger
2020-12-15 8:26 ` Cornelia Huck [this message]
2020-12-15 11:33 ` Halil Pasic
2020-12-15 17:27 ` Cornelia Huck
2020-11-10 14:16 ` Michael Mueller
2020-11-11 12:26 ` Michael Mueller
2020-11-11 12:38 ` Cornelia Huck
2020-11-11 12:49 ` Michael Mueller
2020-11-12 13:31 ` Halil Pasic
2020-11-11 15:16 ` Halil Pasic
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=20201215092656.1b95e030.cohuck@redhat.com \
--to=cohuck@redhat.com \
--cc=borntraeger@de.ibm.com \
--cc=david@redhat.com \
--cc=mimu@linux.ibm.com \
--cc=mst@redhat.com \
--cc=pasic@linux.ibm.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-s390x@nongnu.org \
--cc=thuth@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).