[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 04/11] migration: Teach dirtyrate about qemu_target_page_size()
From: |
Juan Quintela |
Subject: |
[PULL 04/11] migration: Teach dirtyrate about qemu_target_page_size() |
Date: |
Mon, 15 May 2023 14:33:27 +0200 |
Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-Id: <20230511141208.17779-4-quintela@redhat.com>
---
migration/dirtyrate.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/migration/dirtyrate.c b/migration/dirtyrate.c
index ae52c42c4c..9383e91cd6 100644
--- a/migration/dirtyrate.c
+++ b/migration/dirtyrate.c
@@ -313,6 +313,7 @@ static void update_dirtyrate(uint64_t msec)
*/
static uint32_t compute_page_hash(void *ptr)
{
+ size_t page_size = qemu_target_page_size();
uint32_t i;
uint64_t v1, v2, v3, v4;
uint64_t res;
@@ -322,14 +323,14 @@ static uint32_t compute_page_hash(void *ptr)
v2 = QEMU_XXHASH_SEED + XXH_PRIME64_2;
v3 = QEMU_XXHASH_SEED + 0;
v4 = QEMU_XXHASH_SEED - XXH_PRIME64_1;
- for (i = 0; i < TARGET_PAGE_SIZE / 8; i += 4) {
+ for (i = 0; i < page_size / 8; i += 4) {
v1 = XXH64_round(v1, p[i + 0]);
v2 = XXH64_round(v2, p[i + 1]);
v3 = XXH64_round(v3, p[i + 2]);
v4 = XXH64_round(v4, p[i + 3]);
}
res = XXH64_mergerounds(v1, v2, v3, v4);
- res += TARGET_PAGE_SIZE;
+ res += page_size;
res = XXH64_avalanche(res);
return (uint32_t)(res & UINT32_MAX);
}
@@ -344,7 +345,8 @@ static uint32_t get_ramblock_vfn_hash(struct
RamblockDirtyInfo *info,
{
uint32_t hash;
- hash = compute_page_hash(info->ramblock_addr + vfn * TARGET_PAGE_SIZE);
+ hash = compute_page_hash(info->ramblock_addr +
+ vfn * qemu_target_page_size());
trace_get_ramblock_vfn_hash(info->idstr, vfn, hash);
return hash;
--
2.40.1
- [PULL 00/11] Migration 20230515 patches, Juan Quintela, 2023/05/15
- [PULL 01/11] migration/calc-dirty-rate: replaced CRC32 with xxHash, Juan Quintela, 2023/05/15
- [PULL 02/11] softmmu: Create qemu_target_pages_to_MiB(), Juan Quintela, 2023/05/15
- [PULL 07/11] migration: A rate limit value of 0 is valid, Juan Quintela, 2023/05/15
- [PULL 11/11] qemu-file: Remove total from qemu_file_total_transferred_*(), Juan Quintela, 2023/05/15
- [PULL 09/11] qemu-file: make qemu_file_[sg]et_rate_limit() use an uint64_t, Juan Quintela, 2023/05/15
- [PULL 05/11] migration: Teach dirtyrate about qemu_target_page_bits(), Juan Quintela, 2023/05/15
- [PULL 06/11] migration: Make dirtyrate.c target independent, Juan Quintela, 2023/05/15
- [PULL 03/11] Use new created qemu_target_pages_to_MiB(), Juan Quintela, 2023/05/15
- [PULL 04/11] migration: Teach dirtyrate about qemu_target_page_size(),
Juan Quintela <=
- [PULL 08/11] migration: We set the rate_limit by a second, Juan Quintela, 2023/05/15
- [PULL 10/11] qemu-file: Make rate_limit_used an uint64_t, Juan Quintela, 2023/05/15
- Re: [PULL 00/11] Migration 20230515 patches, Richard Henderson, 2023/05/15