From: Wei Yang <richardw.yang@linux.intel.com>
To: qemu-devel@nongnu.org
Cc: rth@twiddle.net, pbonzini@redhat.com, quintela@redhat.com,
dgilbert@redhat.com, wei.w.wang@intel.com,
Wei Yang <richardw.yang@linux.intel.com>
Subject: [Qemu-devel] [PATCH] migration: don't set MIGRATION dirty range for ignored block
Date: Sat, 4 May 2019 13:42:55 +0800 [thread overview]
Message-ID: <20190504054255.8610-1-richardw.yang@linux.intel.com> (raw)
The ignored blocks are not migrated and those ranges are not used.
Signed-off-by: Wei Yang <richardw.yang@linux.intel.com>
---
exec.c | 4 +++-
include/exec/ram_addr.h | 2 ++
migration/ram.c | 2 +-
3 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/exec.c b/exec.c
index 86a38d3b3b..97da155c12 100644
--- a/exec.c
+++ b/exec.c
@@ -2192,6 +2192,8 @@ static void ram_block_add(RAMBlock *new_block, Error **errp, bool shared)
RAMBlock *last_block = NULL;
ram_addr_t old_ram_size, new_ram_size;
Error *err = NULL;
+ uint8_t dirty_memory_clients = ramblock_is_ignored(new_block) ?
+ DIRTY_CLIENTS_NOMIG : DIRTY_CLIENTS_ALL;
old_ram_size = last_ram_page();
@@ -2252,7 +2254,7 @@ static void ram_block_add(RAMBlock *new_block, Error **errp, bool shared)
cpu_physical_memory_set_dirty_range(new_block->offset,
new_block->used_length,
- DIRTY_CLIENTS_ALL);
+ dirty_memory_clients);
if (new_block->host) {
qemu_ram_setup_dump(new_block->host, new_block->max_length);
diff --git a/include/exec/ram_addr.h b/include/exec/ram_addr.h
index a7c81bdb32..4765435fb8 100644
--- a/include/exec/ram_addr.h
+++ b/include/exec/ram_addr.h
@@ -72,6 +72,7 @@ static inline unsigned long int ramblock_recv_bitmap_offset(void *host_addr,
}
bool ramblock_is_pmem(RAMBlock *rb);
+bool ramblock_is_ignored(RAMBlock *rb);
long qemu_getrampagesize(void);
@@ -117,6 +118,7 @@ int qemu_ram_resize(RAMBlock *block, ram_addr_t newsize, Error **errp);
#define DIRTY_CLIENTS_ALL ((1 << DIRTY_MEMORY_NUM) - 1)
#define DIRTY_CLIENTS_NOCODE (DIRTY_CLIENTS_ALL & ~(1 << DIRTY_MEMORY_CODE))
+#define DIRTY_CLIENTS_NOMIG (DIRTY_CLIENTS_ALL & ~(1 << DIRTY_MEMORY_MIGRATION))
void tb_invalidate_phys_range(ram_addr_t start, ram_addr_t end);
diff --git a/migration/ram.c b/migration/ram.c
index 1def8122e9..44525e3816 100644
--- a/migration/ram.c
+++ b/migration/ram.c
@@ -159,7 +159,7 @@ out:
return ret;
}
-static bool ramblock_is_ignored(RAMBlock *block)
+bool ramblock_is_ignored(RAMBlock *block)
{
return !qemu_ram_is_migratable(block) ||
(migrate_ignore_shared() && qemu_ram_is_shared(block));
--
2.19.1
WARNING: multiple messages have this Message-ID (diff)
From: Wei Yang <richardw.yang@linux.intel.com>
To: qemu-devel@nongnu.org
Cc: quintela@redhat.com, dgilbert@redhat.com, wei.w.wang@intel.com,
Wei Yang <richardw.yang@linux.intel.com>,
pbonzini@redhat.com, rth@twiddle.net
Subject: [Qemu-devel] [PATCH] migration: don't set MIGRATION dirty range for ignored block
Date: Sat, 4 May 2019 13:42:55 +0800 [thread overview]
Message-ID: <20190504054255.8610-1-richardw.yang@linux.intel.com> (raw)
Message-ID: <20190504054255.EPqRab81GWjzasfto5NHBE7r54FkFT0bBrrMb-ukF-o@z> (raw)
The ignored blocks are not migrated and those ranges are not used.
Signed-off-by: Wei Yang <richardw.yang@linux.intel.com>
---
exec.c | 4 +++-
include/exec/ram_addr.h | 2 ++
migration/ram.c | 2 +-
3 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/exec.c b/exec.c
index 86a38d3b3b..97da155c12 100644
--- a/exec.c
+++ b/exec.c
@@ -2192,6 +2192,8 @@ static void ram_block_add(RAMBlock *new_block, Error **errp, bool shared)
RAMBlock *last_block = NULL;
ram_addr_t old_ram_size, new_ram_size;
Error *err = NULL;
+ uint8_t dirty_memory_clients = ramblock_is_ignored(new_block) ?
+ DIRTY_CLIENTS_NOMIG : DIRTY_CLIENTS_ALL;
old_ram_size = last_ram_page();
@@ -2252,7 +2254,7 @@ static void ram_block_add(RAMBlock *new_block, Error **errp, bool shared)
cpu_physical_memory_set_dirty_range(new_block->offset,
new_block->used_length,
- DIRTY_CLIENTS_ALL);
+ dirty_memory_clients);
if (new_block->host) {
qemu_ram_setup_dump(new_block->host, new_block->max_length);
diff --git a/include/exec/ram_addr.h b/include/exec/ram_addr.h
index a7c81bdb32..4765435fb8 100644
--- a/include/exec/ram_addr.h
+++ b/include/exec/ram_addr.h
@@ -72,6 +72,7 @@ static inline unsigned long int ramblock_recv_bitmap_offset(void *host_addr,
}
bool ramblock_is_pmem(RAMBlock *rb);
+bool ramblock_is_ignored(RAMBlock *rb);
long qemu_getrampagesize(void);
@@ -117,6 +118,7 @@ int qemu_ram_resize(RAMBlock *block, ram_addr_t newsize, Error **errp);
#define DIRTY_CLIENTS_ALL ((1 << DIRTY_MEMORY_NUM) - 1)
#define DIRTY_CLIENTS_NOCODE (DIRTY_CLIENTS_ALL & ~(1 << DIRTY_MEMORY_CODE))
+#define DIRTY_CLIENTS_NOMIG (DIRTY_CLIENTS_ALL & ~(1 << DIRTY_MEMORY_MIGRATION))
void tb_invalidate_phys_range(ram_addr_t start, ram_addr_t end);
diff --git a/migration/ram.c b/migration/ram.c
index 1def8122e9..44525e3816 100644
--- a/migration/ram.c
+++ b/migration/ram.c
@@ -159,7 +159,7 @@ out:
return ret;
}
-static bool ramblock_is_ignored(RAMBlock *block)
+bool ramblock_is_ignored(RAMBlock *block)
{
return !qemu_ram_is_migratable(block) ||
(migrate_ignore_shared() && qemu_ram_is_shared(block));
--
2.19.1
next reply other threads:[~2019-05-04 5:43 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-04 5:42 Wei Yang [this message]
2019-05-04 5:42 ` [Qemu-devel] [PATCH] migration: don't set MIGRATION dirty range for ignored block Wei Yang
2019-05-05 3:29 ` Wei Yang
2019-05-05 3:29 ` 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=20190504054255.8610-1-richardw.yang@linux.intel.com \
--to=richardw.yang@linux.intel.com \
--cc=dgilbert@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=quintela@redhat.com \
--cc=rth@twiddle.net \
--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 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.