From: Raphael Norwitz <raphael.norwitz@nutanix.com>
To: mst@redhat.com, qemu-devel@nongnu.org
Subject: Re: [RFC PATCH 0/3] vhost-user: Lift Max Ram Slots Limitation
Date: Mon, 13 Jan 2020 11:43:13 -0800 [thread overview]
Message-ID: <20200113194313.GA73843@raphael-norwitz.user.nutanix.com> (raw)
In-Reply-To: <1575874847-5792-1-git-send-email-raphael.norwitz@nutanix.com>
Ping
On Mon, Dec 09, 2019 at 02:00:44AM -0500, Raphael Norwitz wrote:
>
> In QEMU today, a VM with a vhost-user device can hot add memory a
> maximum of 8 times. See these threads, among others:
>
> [1] https://lists.gnu.org/archive/html/qemu-devel/2019-07/msg01046.html
> https://lists.gnu.org/archive/html/qemu-devel/2019-07/msg01236.html
>
> [2] https://lists.gnu.org/archive/html/qemu-devel/2017-11/msg04656.html
>
> This RFC/patch set introduces a new protocol feature
> VHOST_USER_PROTOCOL_F_CONFIGURE_SLOTS which, when enabled, lifts the
> restriction on the maximum number RAM slots imposed by vhost-user.
>
> The patch consists of 3 changes:
> 1. Fixed Error Handling in vhost_user_set_mem_table_postcopy:
> This is a bug fix in the postcopy migration path
> 2. vhost-user: Refactor vhost_user_set_mem_table Functions:
> This is a non-functional change refractoring the
> vhost_user_set_mem_table and vhost_user_set_mem_table_postcopy
> functions such that the feature can be more cleanly added.
> 3. Introduce Configurable Number of Memory Slots Exposed by vhost-user:
> This change introduces the new protocol feature
> VHOST_USER_PROTOCOL_F_CONFIGURE_SLOTS.
>
> The implementation details are explained in more detail in the commit
> messages, but at a high level the new protocol feature works as follows:
> - If the VHOST_USER_PROTCOL_F_CONFIGURE_SLOTS feature is enabled, QEMU will
> send multiple VHOST_USER_ADD_MEM_REG and VHOST_USER_REM_MEM_REG
> messages to map and unmap individual memory regions instead of one large
> VHOST_USER_SET_MEM_TABLE message containing all memory regions.
> - The vhost-user struct maintains a ’shadow state’ of memory regions
> already sent to the guest. Each time vhost_user_set_mem_table is called,
> the shadow state is compared with the new device state. A
> VHOST_USER_REM_MEM_REG will be sent for each region in the shadow state
> not in the device state. Then, a VHOST_USER_ADD_MEM_REG will be sent
> for each region in the device state but not the shadow state. After
> these messages have been sent, the shadow state will be updated to
> reflect the new device state.
>
> The VHOST_USER_SET_MEM_TABLE message was not reused because as the number of
> regions grows, the message becomes very large. In practice, such large
> messages caused problems (truncated messages) and in the past it seems the
> community has opted for smaller fixed size messages where possible. VRINGs,
> for example, are sent to the backend individually instead of in one massive
> message.
>
> Current Limitations:
> - postcopy migration is not supported when the
> VHOST_USER_PROTOCOL_F_CONFIGURE_SLOTS has been negotiated.
> - VHOST_USER_PROTOCOL_F_CONFIGURE_SLOTS cannot be negotiated when
> VHOST_USER_PROTOCOL_F_REPLY_ACK has also been negotiated.
>
> Both of these limitations are due to resource contraints. They are not
> imposed for technical reasons.
>
> Questions:
> - In the event transmitting a VHOST_USER_ADD_MEM_REG or
> VHOST_USER_REM_REG message fails, is there any reason the error handling
> should differ from when transmitting VHOST_USER_SET_MEM_TABLE message fails?
> - Is there a cleaner way to ensure to ensure a postcopy migration cannot be
> started with this protocol feature enabled?
>
> Best,
> Raphael
>
> Raphael Norwitz (3):
> Fixed Error Handling in vhost_user_set_mem_table_postcopy
> vhost-user: Refactor vhost_user_set_mem_table Functions
> Introduce Configurable Number of Memory Slots Exposed by vhost-user:
>
> docs/interop/vhost-user.rst | 43 +++++
> hw/virtio/vhost-user.c | 384 +++++++++++++++++++++++++++++++++-----------
> 2 files changed, 335 insertions(+), 92 deletions(-)
>
> --
> 1.8.3.1
>
>
prev parent reply other threads:[~2020-01-13 19:44 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-09 7:00 [RFC PATCH 0/3] vhost-user: Lift Max Ram Slots Limitation Raphael Norwitz
2019-12-09 7:00 ` [RFC PATCH 1/3] Fixed Error Handling in vhost_user_set_mem_table_postcopy Raphael Norwitz
2020-01-14 7:07 ` Michael S. Tsirkin
2020-01-16 3:16 ` Raphael Norwitz
2019-12-09 7:00 ` [RFC PATCH 2/3] vhost-user: Refactor vhost_user_set_mem_table Functions Raphael Norwitz
2019-12-09 7:00 ` [RFC PATCH 3/3] Introduce Configurable Number of Memory Slots Exposed by vhost-user: Raphael Norwitz
2020-01-14 7:12 ` Michael S. Tsirkin
2020-01-16 3:23 ` Raphael Norwitz
2020-01-22 8:57 ` Michael S. Tsirkin
2020-01-13 19:43 ` Raphael Norwitz [this message]
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=20200113194313.GA73843@raphael-norwitz.user.nutanix.com \
--to=raphael.norwitz@nutanix.com \
--cc=mst@redhat.com \
--cc=qemu-devel@nongnu.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;
as well as URLs for NNTP newsgroup(s).