[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v3 1/7] migration: Remove static allocation of xzblr
From: |
Peter Maydell |
Subject: |
[Qemu-devel] [PATCH v3 1/7] migration: Remove static allocation of xzblre cache buffer |
Date: |
Tue, 11 Oct 2016 18:08:13 +0100 |
From: Vijaya Kumar K <address@hidden>
Allocate xzblre zero page cache buffer dynamically.
Remove dependency on TARGET_PAGE_SIZE to make run-time
page size detection for arm platforms.
Signed-off-by: Vijaya Kumar K <address@hidden>
Message-id: address@hidden
Reviewed-by: Peter Maydell <address@hidden>
Reviewed-by: Richard Henderson <address@hidden>
Signed-off-by: Peter Maydell <address@hidden>
---
migration/ram.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/migration/ram.c b/migration/ram.c
index c8ec9f2..b5bde00 100644
--- a/migration/ram.c
+++ b/migration/ram.c
@@ -69,7 +69,7 @@ static uint64_t bitmap_sync_count;
/* 0x80 is reserved in migration.h start with 0x100 next */
#define RAM_SAVE_FLAG_COMPRESS_PAGE 0x100
-static const uint8_t ZERO_TARGET_PAGE[TARGET_PAGE_SIZE];
+static uint8_t *ZERO_TARGET_PAGE;
static inline bool is_zero_range(uint8_t *p, uint64_t size)
{
@@ -1429,6 +1429,7 @@ static void ram_migration_cleanup(void *opaque)
cache_fini(XBZRLE.cache);
g_free(XBZRLE.encoded_buf);
g_free(XBZRLE.current_buf);
+ g_free(ZERO_TARGET_PAGE);
XBZRLE.cache = NULL;
XBZRLE.encoded_buf = NULL;
XBZRLE.current_buf = NULL;
@@ -1887,6 +1888,7 @@ static int ram_save_setup(QEMUFile *f, void *opaque)
if (migrate_use_xbzrle()) {
XBZRLE_cache_lock();
+ ZERO_TARGET_PAGE = g_malloc0(TARGET_PAGE_SIZE);
XBZRLE.cache = cache_init(migrate_xbzrle_cache_size() /
TARGET_PAGE_SIZE,
TARGET_PAGE_SIZE);
--
2.7.4
- [Qemu-devel] [PATCH v3 0/7] Runtime pagesize computation, Peter Maydell, 2016/10/11
- [Qemu-devel] [PATCH v3 5/7] migration/savevm.c: migrate non-default page size, Peter Maydell, 2016/10/11
- [Qemu-devel] [PATCH v3 1/7] migration: Remove static allocation of xzblre cache buffer,
Peter Maydell <=
- [Qemu-devel] [PATCH v3 4/7] cpu: Support a target CPU having a variable page size, Peter Maydell, 2016/10/11
- [Qemu-devel] [PATCH v3 2/7] exec.c: Remove static allocation of sub_section of sub_page, Peter Maydell, 2016/10/11
- Re: [Qemu-devel] [Qemu-arm] [PATCH v3 0/7] Runtime pagesize computation, Peter Maydell, 2016/10/11
- Re: [Qemu-devel] [PATCH v3 0/7] Runtime pagesize computation, Richard Henderson, 2016/10/11
- Re: [Qemu-devel] [PATCH v3 0/7] Runtime pagesize computation, no-reply, 2016/10/11
- Re: [Qemu-devel] [Qemu-arm] [PATCH v3 0/7] Runtime pagesize computation, Peter Maydell, 2016/10/21