All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@redhat.com>
To: Markus Armbruster <armbru@redhat.com>
Cc: Kevin Wolf <kwolf@redhat.com>,
	Laurent Vivier <lvivier@redhat.com>,
	Thomas Huth <thuth@redhat.com>,
	qemu-block@nongnu.org, qemu-devel@nongnu.org,
	Coiby Xu <Coiby.Xu@gmail.com>, Max Reitz <mreitz@redhat.com>,
	Paolo Bonzini <pbonzini@redhat.com>
Subject: Re: [PATCH 1/2] block/export: add vhost-user-blk multi-queue support
Date: Fri, 2 Oct 2020 14:47:53 +0100	[thread overview]
Message-ID: <20201002134753.GC579943@stefanha-x1.localdomain> (raw)
In-Reply-To: <87tuvdry4o.fsf@dusky.pond.sub.org>

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

On Fri, Oct 02, 2020 at 07:32:39AM +0200, Markus Armbruster wrote:
> Stefan Hajnoczi <stefanha@redhat.com> writes:
> 
> > Allow the number of queues to be configured using --export
> > vhost-user-blk,num-queues=N. This setting should match the QEMU --device
> > vhost-user-blk-pci,num-queues=N setting but QEMU vhost-user-blk.c lowers
> > its own value if the vhost-user-blk backend offers fewer queues than
> > QEMU.
> >
> > The vhost-user-blk-server.c code is already capable of multi-queue. All
> > virtqueue processing runs in the same AioContext. No new locking is
> > needed.
> >
> > Add the num-queues=N option and set the VIRTIO_BLK_F_MQ feature bit.
> > Note that the feature bit only announces the presence of the num_queues
> > configuration space field. It does not promise that there is more than 1
> > virtqueue, so we can set it unconditionally.
> >
> > I tested multi-queue by running a random read fio test with numjobs=4 on
> > an -smp 4 guest. After the benchmark finished the guest /proc/interrupts
> > file showed activity on all 4 virtio-blk MSI-X. The /sys/block/vda/mq/
> > directory shows that Linux blk-mq has 4 queues configured.
> >
> > An automated test is included in the next commit.
> >
> > Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
> > ---
> >  qapi/block-export.json               |  6 +++++-
> >  block/export/vhost-user-blk-server.c | 24 ++++++++++++++++++------
> >  2 files changed, 23 insertions(+), 7 deletions(-)
> >
> > diff --git a/qapi/block-export.json b/qapi/block-export.json
> > index a793e34af9..17020de257 100644
> > --- a/qapi/block-export.json
> > +++ b/qapi/block-export.json
> > @@ -93,11 +93,15 @@
> >  #        SocketAddress types are supported. Passed fds must be UNIX domain
> >  #        sockets.
> >  # @logical-block-size: Logical block size in bytes. Defaults to 512 bytes.
> > +# @num-queues: Number of request virtqueues. Must be greater than 0. Defaults
> > +#              to 1.
> >  #
> >  # Since: 5.2
> >  ##
> >  { 'struct': 'BlockExportOptionsVhostUserBlk',
> > -  'data': { 'addr': 'SocketAddress', '*logical-block-size': 'size' } }
> > +  'data': { 'addr': 'SocketAddress',
> > +	    '*logical-block-size': 'size',
> 
> Tab damage.

Oops, thanks! I have updated my editor configuration to use 4-space
indents for .json files :).

> > +            '*num-queues': 'uint16'} }
> 
> Out of curiosity: what made you pick 16 bit signed?  net.json uses both
> 32 and 64 bit signed.  Odd...

struct virtio_blk_config {
    __u16 num_queues;
}

Also, virtio-pci and virtio-ccw use 16-bit types for the queue count.

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

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

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-01 14:46 [PATCH 0/2] block/export: add vhost-user-blk multi-queue support Stefan Hajnoczi
2020-10-01 14:46 ` [PATCH 1/2] " Stefan Hajnoczi
2020-10-02  5:32   ` Markus Armbruster
2020-10-02 13:47     ` Stefan Hajnoczi [this message]
2020-10-01 14:46 ` [PATCH 2/2] tests/qtest: add multi-queue test case to vhost-user-blk-test Stefan Hajnoczi
2020-10-09 10:16 ` [PATCH 0/2] block/export: add vhost-user-blk multi-queue support Stefan Hajnoczi

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=20201002134753.GC579943@stefanha-x1.localdomain \
    --to=stefanha@redhat.com \
    --cc=Coiby.Xu@gmail.com \
    --cc=armbru@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=lvivier@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.