From: Wei Yang <richardw.yang@linux.intel.com>
To: qemu-devel@nongnu.org
Cc: Wei Yang <richardw.yang@linux.intel.com>,
dgilbert@redhat.com, quintela@redhat.com
Subject: [Qemu-devel] [RFC PATCH] migration/postcopy: skip compression when postcopy is active
Date: Thu, 25 Jul 2019 11:27:22 +0800 [thread overview]
Message-ID: <20190725032722.32271-1-richardw.yang@linux.intel.com> (raw)
Now postcopy is not compatible with compression. And we disable setting
these two capability at the same time. While we can still leverage
compress before postcopy is active, for example at the bulk stage.
This patch skips compression when postcopy is active instead of
forbidding setting these capability at the same time.
Signed-off-by: Wei Yang <richardw.yang@linux.intel.com>
---
migration/migration.c | 11 -----------
migration/ram.c | 10 ++++++++++
2 files changed, 10 insertions(+), 11 deletions(-)
diff --git a/migration/migration.c b/migration/migration.c
index 5a496addbd..33c373033d 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -995,17 +995,6 @@ static bool migrate_caps_check(bool *cap_list,
#endif
if (cap_list[MIGRATION_CAPABILITY_POSTCOPY_RAM]) {
- if (cap_list[MIGRATION_CAPABILITY_COMPRESS]) {
- /* The decompression threads asynchronously write into RAM
- * rather than use the atomic copies needed to avoid
- * userfaulting. It should be possible to fix the decompression
- * threads for compatibility in future.
- */
- error_setg(errp, "Postcopy is not currently compatible "
- "with compression");
- return false;
- }
-
/* This check is reasonably expensive, so only when it's being
* set the first time, also it's only the destination that needs
* special support.
diff --git a/migration/ram.c b/migration/ram.c
index da12774a24..a0d3bc60b2 100644
--- a/migration/ram.c
+++ b/migration/ram.c
@@ -2384,6 +2384,16 @@ static bool save_page_use_compression(RAMState *rs)
return false;
}
+ /*
+ * The decompression threads asynchronously write into RAM
+ * rather than use the atomic copies needed to avoid
+ * userfaulting. It should be possible to fix the decompression
+ * threads for compatibility in future.
+ */
+ if (migration_in_postcopy()) {
+ return false;
+ }
+
/*
* If xbzrle is on, stop using the data compression after first
* round of migration even if compression is enabled. In theory,
--
2.17.1
next reply other threads:[~2019-07-25 3:28 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-25 3:27 Wei Yang [this message]
2019-08-23 16:27 ` [Qemu-devel] [RFC PATCH] migration/postcopy: skip compression when postcopy is active Dr. David Alan Gilbert
2019-08-26 12:37 ` Wei Yang
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=20190725032722.32271-1-richardw.yang@linux.intel.com \
--to=richardw.yang@linux.intel.com \
--cc=dgilbert@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=quintela@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 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).