[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCHv2 5/9] migration: search for zero instead of dup pag
From: |
Peter Lieven |
Subject: |
[Qemu-devel] [PATCHv2 5/9] migration: search for zero instead of dup pages |
Date: |
Fri, 15 Mar 2013 16:50:14 +0100 |
virtually all dup pages are zero pages. remove
the speical is_dup_page() function and use the
optimized buffer_is_zero() function instead.
Signed-off-by: Peter Lieven <address@hidden>
---
arch_init.c | 17 +----------------
1 file changed, 1 insertion(+), 16 deletions(-)
diff --git a/arch_init.c b/arch_init.c
index 1b71912..87c16fc 100644
--- a/arch_init.c
+++ b/arch_init.c
@@ -144,21 +144,6 @@ int qemu_read_default_config_files(bool userconfig)
return 0;
}
-static int is_dup_page(uint8_t *page)
-{
- VECTYPE *p = (VECTYPE *)page;
- VECTYPE val = SPLAT(page);
- int i;
-
- for (i = 0; i < TARGET_PAGE_SIZE / sizeof(VECTYPE); i++) {
- if (!ALL_EQ(val, p[i])) {
- return 0;
- }
- }
-
- return 1;
-}
-
/* struct contains XBZRLE cache and a static page
used by the compression */
static struct {
@@ -443,7 +428,7 @@ static int ram_save_block(QEMUFile *f, bool last_stage)
/* In doubt sent page as normal */
bytes_sent = -1;
- if (is_dup_page(p)) {
+ if (buffer_is_zero(p, TARGET_PAGE_SIZE)) {
acct_info.dup_pages++;
bytes_sent = save_block_hdr(f, block, offset, cont,
RAM_SAVE_FLAG_COMPRESS);
--
1.7.9.5
- Re: [Qemu-devel] [PATCHv2 3/9] buffer_is_zero: use vector optimizations if possible, (continued)
[Qemu-devel] [PATCHv2 7/9] migration: do not sent zero pages in bulk stage, Peter Lieven, 2013/03/15
[Qemu-devel] [PATCHv2 5/9] migration: search for zero instead of dup pages,
Peter Lieven <=
[Qemu-devel] [PATCHv2 1/9] move vector definitions to qemu-common.h, Peter Lieven, 2013/03/15
[Qemu-devel] [PATCHv2 6/9] migration: add an indicator for bulk state of ram migration, Peter Lieven, 2013/03/15