From: Rusty Russell <rusty@rustcorp.com.au>
To: Gleb Natapov <gleb@redhat.com>,
virtualization@lists.linux-foundation.org
Cc: mst@redhat.com
Subject: Re: Make virtio vq size configurable by a guest.
Date: Tue, 21 Jun 2011 11:32:04 +0930 [thread overview]
Message-ID: <878vswhrhf.fsf@rustcorp.com.au> (raw)
In-Reply-To: <20110620131624.GZ491@redhat.com>
On Mon, 20 Jun 2011 16:16:24 +0300, Gleb Natapov <gleb@redhat.com> wrote:
> Hi,
>
> Currently in virtio host dictates the size and layout of vq that should
> be used. To talk to a device that has one vq with 128 elements guest
> needs to allocate at least 2 pages. Usually this is not a problem, but
> sometimes guest runs in a resource restricted environment and then it may
> not have enough memory to initialize all virtio devices present in the
> system. One such environment is a BIOS. Seabios currently has virtio block
> support. Since the BIOS should be able to access the disk even after OS
> is launched vq should be allocated from a special memory region that will
> be marked as unavailable to an OS, but such memory is scarce. Because vq
> is so huge only a couple of virtio disks can be initialized by the BIOS.
>
> It would be nice if a guest will be able to tell to a host what vq size
> should be used instead. BIOS issues only one request at a time anyway,
> so it needs only one element in vq. It does not care about performance
> to much either, so it can tell to a host to not align used index to a
> page boundary. This way vq of one element shouldn't take more then a couple
> hundreds of bytes.
Unfortunately, a virtqueue *always* takes at least 2 pages. That's
because we split the host/guest part on page boundaries. (2 pages per
disk is "huge"? Really?)
So really, you want to negotiate the ring size and the 'align'
parameter. A new feature could allow this, but there may be valid
reasons for a host to want to place an upper limit, too.
Thanks,
Rusty.
next prev parent reply other threads:[~2011-06-21 2:02 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-20 13:16 Make virtio vq size configurable by a guest Gleb Natapov
2011-06-21 2:02 ` Rusty Russell [this message]
2011-06-22 10:21 ` Gleb Natapov
2011-06-23 0:48 ` Rusty Russell
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=878vswhrhf.fsf@rustcorp.com.au \
--to=rusty@rustcorp.com.au \
--cc=gleb@redhat.com \
--cc=mst@redhat.com \
--cc=virtualization@lists.linux-foundation.org \
/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