qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Dr. David Alan Gilbert (git)" <dgilbert@redhat.com>
To: qemu-devel@nongnu.org, quintela@redhat.com
Cc: peterx@redhat.com, lvivier@redhat.com, groug@kaod.org,
	ross.lagerwall@citrix.com, wei.w.wang@intel.com,
	danielhb@linux.vnet.ibm.com
Subject: [Qemu-devel] [PULL 03/14] migration/savevm.c: set MAX_VM_CMD_PACKAGED_SIZE to 1ul << 32
Date: Tue,  6 Feb 2018 15:49:25 +0000	[thread overview]
Message-ID: <20180206154936.13565-4-dgilbert@redhat.com> (raw)
In-Reply-To: <20180206154936.13565-1-dgilbert@redhat.com>

From: Daniel Henrique Barboza <danielhb@linux.vnet.ibm.com>

MAX_VM_CMD_PACKAGED_SIZE is a constant used in qemu_savevm_send_packaged
and loadvm_handle_cmd_packaged to determine whether a package is too
big to be sent or received. qemu_savevm_send_packaged is called inside
postcopy_start (migration/migration.c) to send the MigrationState
in a single blob to the destination, using the MIG_CMD_PACKAGED subcommand,
which will read it up using loadvm_handle_cmd_packaged. If the blob is
larger than MAX_VM_CMD_PACKAGED_SIZE, an error is thrown and the postcopy
migration is aborted. Both MAX_VM_CMD_PACKAGED_SIZE and MIG_CMD_PACKAGED
were introduced by commit 11cf1d984b ("MIG_CMD_PACKAGED: Send a packaged
chunk ..."). The constant has its original value of 1ul << 24 (16MB).

The current MAX_VM_CMD_PACKAGED_SIZE value is not enough to support postcopy
migration of bigger pseries guests. The blob size for a postcopy migration of
a pseries guest with the following setup:

qemu-system-ppc64 --nographic -vga none -machine pseries,accel=kvm -m 64G \
-smp 1,maxcpus=32 -device virtio-blk-pci,drive=rootdisk \
-drive file=f27.qcow2,if=none,cache=none,format=qcow2,id=rootdisk \
-netdev user,id=u1 -net nic,netdev=u1

Goes around 12MB. Bumping the RAM to 128G makes the blob sizes goes to 20MB.
With 256G the blob goes to 37MB - more than twice the current maximum size.
At this moment the pseries machine can handle guests with up to 1TB of RAM,
making this postcopy blob goes to 128MB of size approximately.

Following the discussions made in [1], there is a need to understand what
devices are aggressively consuming the blob in that manner and see if that
can be mitigated. Until then, we can set MAX_VM_CMD_PACKAGED_SIZE to the
maximum value allowed. Since the size is a 32 bit int variable, we can set
it as 1ul << 32, giving a maximum blob size of 4G that is enough to support
postcopy migration of 32TB RAM guests given the above constraints.

[1] https://lists.nongnu.org/archive/html/qemu-devel/2018-01/msg06313.html

Signed-off-by: Daniel Henrique Barboza <danielhb@linux.vnet.ibm.com>
Reported-by: Balamuruhan S <bala24@linux.vnet.ibm.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
---
 migration/savevm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/migration/savevm.c b/migration/savevm.c
index b7908f62be..b8e9c532af 100644
--- a/migration/savevm.c
+++ b/migration/savevm.c
@@ -81,7 +81,7 @@ enum qemu_vm_cmd {
     MIG_CMD_MAX
 };
 
-#define MAX_VM_CMD_PACKAGED_SIZE (1ul << 24)
+#define MAX_VM_CMD_PACKAGED_SIZE UINT32_MAX
 static struct mig_cmd_args {
     ssize_t     len; /* -1 = variable */
     const char *name;
-- 
2.14.3

  parent reply	other threads:[~2018-02-06 15:50 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-06 15:49 [Qemu-devel] [PULL 00/14] migration queue Dr. David Alan Gilbert (git)
2018-02-06 15:49 ` [Qemu-devel] [PULL 01/14] migration: Allow migrate_fd_connect to take an Error * Dr. David Alan Gilbert (git)
2018-02-06 15:49 ` [Qemu-devel] [PULL 02/14] migration: Route errors down through migration_channel_connect Dr. David Alan Gilbert (git)
2018-02-06 15:49 ` Dr. David Alan Gilbert (git) [this message]
2018-02-06 15:49 ` [Qemu-devel] [PULL 04/14] migration: use s->threshold_size inside migration_update_counters Dr. David Alan Gilbert (git)
2018-02-06 15:49 ` [Qemu-devel] [PULL 05/14] migration: Drop current address parameter from save_zero_page() Dr. David Alan Gilbert (git)
2018-02-06 15:49 ` [Qemu-devel] [PULL 06/14] tests: Remove deprecated migration tests commands Dr. David Alan Gilbert (git)
2018-02-06 15:49 ` [Qemu-devel] [PULL 07/14] tests: Consolidate accelerators declaration Dr. David Alan Gilbert (git)
2018-02-06 15:49 ` [Qemu-devel] [PULL 08/14] tests: Use consistent names for migration Dr. David Alan Gilbert (git)
2018-02-06 15:49 ` [Qemu-devel] [PULL 09/14] tests: Add deprecated commands migration test Dr. David Alan Gilbert (git)
2018-02-06 15:49 ` [Qemu-devel] [PULL 10/14] tests: Create migrate-start-postcopy command Dr. David Alan Gilbert (git)
2018-02-06 15:49 ` [Qemu-devel] [PULL 11/14] tests: Adjust sleeps for migration test Dr. David Alan Gilbert (git)
2018-02-06 15:49 ` [Qemu-devel] [PULL 12/14] migration: Recover block devices if failure in device state Dr. David Alan Gilbert (git)
2018-02-06 15:49 ` [Qemu-devel] [PULL 13/14] migration: Don't leak IO channels Dr. David Alan Gilbert (git)
2018-02-06 15:49 ` [Qemu-devel] [PULL 14/14] migration: incoming postcopy advise sanity checks Dr. David Alan Gilbert (git)
2018-02-07 14:38 ` [Qemu-devel] [PULL 00/14] migration queue Peter Maydell

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=20180206154936.13565-4-dgilbert@redhat.com \
    --to=dgilbert@redhat.com \
    --cc=danielhb@linux.vnet.ibm.com \
    --cc=groug@kaod.org \
    --cc=lvivier@redhat.com \
    --cc=peterx@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@redhat.com \
    --cc=ross.lagerwall@citrix.com \
    --cc=wei.w.wang@intel.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).