qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@redhat.com>
To: Denis Plotnikov <dplotnikov@virtuozzo.com>
Cc: kwolf@redhat.com, fam@euphon.net, vsementsov@virtuozzo.com,
	ehabkost@redhat.com, qemu-block@nongnu.org, mst@redhat.com,
	Stefan Hajnoczi <stefanha@gmail.com>,
	qemu-devel@nongnu.org, mreitz@redhat.com, pbonzini@redhat.com,
	den@virtuozzo.com
Subject: Re: [PATCH v2] virtio: increase virtuqueue size for virtio-scsi and virtio-blk
Date: Thu, 13 Feb 2020 09:08:51 +0000	[thread overview]
Message-ID: <20200213090851.GA542404@stefanha-x1.localdomain> (raw)
In-Reply-To: <f4e65d26-3dac-fbd5-ad63-2d2955ad8d97@virtuozzo.com>

[-- Attachment #1: Type: text/plain, Size: 2563 bytes --]

On Thu, Feb 13, 2020 at 11:08:35AM +0300, Denis Plotnikov wrote:
> On 12.02.2020 18:43, Stefan Hajnoczi wrote:
> > On Tue, Feb 11, 2020 at 05:14:14PM +0300, Denis Plotnikov wrote:
> > > The goal is to reduce the amount of requests issued by a guest on
> > > 1M reads/writes. This rises the performance up to 4% on that kind of
> > > disk access pattern.
> > > 
> > > The maximum chunk size to be used for the guest disk accessing is
> > > limited with seg_max parameter, which represents the max amount of
> > > pices in the scatter-geather list in one guest disk request.
> > > 
> > > Since seg_max is virqueue_size dependent, increasing the virtqueue
> > > size increases seg_max, which, in turn, increases the maximum size
> > > of data to be read/write from a guest disk.
> > > 
> > > More details in the original problem statment:
> > > https://lists.gnu.org/archive/html/qemu-devel/2017-12/msg03721.html
> > > 
> > > Suggested-by: Denis V. Lunev <den@openvz.org>
> > > Signed-off-by: Denis Plotnikov <dplotnikov@virtuozzo.com>
> > > ---
> > >   hw/block/virtio-blk.c | 4 ++--
> > >   hw/core/machine.c     | 2 ++
> > >   hw/scsi/virtio-scsi.c | 4 ++--
> > >   3 files changed, 6 insertions(+), 4 deletions(-)
> > > 
> > > diff --git a/hw/block/virtio-blk.c b/hw/block/virtio-blk.c
> > > index 09f46ed85f..6df3a7a6df 100644
> > > --- a/hw/block/virtio-blk.c
> > > +++ b/hw/block/virtio-blk.c
> > > @@ -914,7 +914,7 @@ static void virtio_blk_update_config(VirtIODevice *vdev, uint8_t *config)
> > >       memset(&blkcfg, 0, sizeof(blkcfg));
> > >       virtio_stq_p(vdev, &blkcfg.capacity, capacity);
> > >       virtio_stl_p(vdev, &blkcfg.seg_max,
> > > -                 s->conf.seg_max_adjust ? s->conf.queue_size - 2 : 128 - 2);
> > > +                 s->conf.seg_max_adjust ? s->conf.queue_size - 2 : 256 - 2);
> > This value must not change on older machine types.
> Yes, that's true, but ..
> > So does this patch
> > need to turn seg-max-adjust *on* in hw_compat_4_2 so that old machine
> > types get 126 instead of 254?
> If we set seg-max-adjust "on" in older machine types, the setups using them
> and having queue_sizes set , for example, 1024 will also set seg_max to 1024
> - 2 which isn't the expected behavior: older mt didn't change seg_max in
> that case and stuck with 128 - 2.
> So, should we, instead, leave the default 128 - 2, for seg_max?

Argh!  Good point :-).

How about a seg_max_default property that is initialized to 254 for
modern machines and 126 to old machines?

Stefan

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2020-02-13  9:10 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-11 14:14 [PATCH v2] virtio: increase virtuqueue size for virtio-scsi and virtio-blk Denis Plotnikov
2020-02-12 15:43 ` Stefan Hajnoczi
2020-02-13  8:08   ` Denis Plotnikov
2020-02-13  9:08     ` Stefan Hajnoczi [this message]
2020-02-13  9:28       ` Denis Plotnikov
2020-02-13 11:45         ` Stefan Hajnoczi
2020-02-13 12:41           ` Denis Plotnikov
2020-02-13 14:59 Denis Plotnikov
2020-02-13 15:43 ` Philippe Mathieu-Daudé
2020-02-18 13:53 ` Stefan Hajnoczi
2020-02-18 13:59   ` Denis Plotnikov
2020-02-18 14:03     ` Denis Plotnikov

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=20200213090851.GA542404@stefanha-x1.localdomain \
    --to=stefanha@redhat.com \
    --cc=den@virtuozzo.com \
    --cc=dplotnikov@virtuozzo.com \
    --cc=ehabkost@redhat.com \
    --cc=fam@euphon.net \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@gmail.com \
    --cc=vsementsov@virtuozzo.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).