From 45f33f01f359d6028ec4b4018a2bf2ff53806e11 Mon Sep 17 00:00:00 2001 From: Juan Quintela Date: Fri, 22 Jun 2012 15:21:07 +0200 Subject: Maintain the number of dirty pages Calculate the number of dirty pages takes a lot on hosts with lots of memory. Just maintain how many pages are dirty. Signed-off-by: Juan Quintela --- arch_init.c | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) (limited to 'arch_init.c') diff --git a/arch_init.c b/arch_init.c index 64b85fd1b1..5b0f5626a9 100644 --- a/arch_init.c +++ b/arch_init.c @@ -238,20 +238,7 @@ static uint64_t bytes_transferred; static ram_addr_t ram_save_remaining(void) { - RAMBlock *block; - ram_addr_t count = 0; - - QLIST_FOREACH(block, &ram_list.blocks, next) { - ram_addr_t addr; - for (addr = 0; addr < block->length; addr += TARGET_PAGE_SIZE) { - if (memory_region_get_dirty(block->mr, addr, TARGET_PAGE_SIZE, - DIRTY_MEMORY_MIGRATION)) { - count++; - } - } - } - - return count; + return ram_list.dirty_pages; } uint64_t ram_bytes_remaining(void) -- cgit v1.2.3-55-g7522