[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 32/36] migration: No off-by-one for pss->page update in host page
From: |
Juan Quintela |
Subject: |
[PULL 32/36] migration: No off-by-one for pss->page update in host page size |
Date: |
Fri, 28 Jan 2022 19:30:29 +0100 |
From: Peter Xu <peterx@redhat.com>
We used to do off-by-one fixup for pss->page when finished one host huge page
transfer. That seems to be unnecesary at all. Drop it.
Cc: Keqian Zhu <zhukeqian1@huawei.com>
Cc: Kunkun Jiang <jiangkunkun@huawei.com>
Cc: Andrey Gruzdev <andrey.gruzdev@virtuozzo.com>
Signed-off-by: Peter Xu <peterx@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
---
migration/ram.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/migration/ram.c b/migration/ram.c
index ca879c744f..58adcaf430 100644
--- a/migration/ram.c
+++ b/migration/ram.c
@@ -1617,7 +1617,7 @@ static int ram_save_release_protection(RAMState *rs,
PageSearchStatus *pss,
/* Check if page is from UFFD-managed region. */
if (pss->block->flags & RAM_UF_WRITEPROTECT) {
void *page_address = pss->block->host + (start_page <<
TARGET_PAGE_BITS);
- uint64_t run_length = (pss->page - start_page + 1) << TARGET_PAGE_BITS;
+ uint64_t run_length = (pss->page - start_page) << TARGET_PAGE_BITS;
/* Flush async buffers before un-protect. */
qemu_fflush(rs->f);
@@ -2230,7 +2230,7 @@ static int ram_save_host_page(RAMState *rs,
PageSearchStatus *pss)
offset_in_ramblock(pss->block,
((ram_addr_t)pss->page) << TARGET_PAGE_BITS));
/* The offset we leave with is the min boundary of host page and block */
- pss->page = MIN(pss->page, hostpage_boundary) - 1;
+ pss->page = MIN(pss->page, hostpage_boundary);
res = ram_save_release_protection(rs, pss, start_page);
return (res < 0 ? res : pages);
--
2.34.1
- [PULL 20/36] migration/migration.c: Avoid COLO boot in postcopy migration, (continued)
- [PULL 20/36] migration/migration.c: Avoid COLO boot in postcopy migration, Juan Quintela, 2022/01/28
- [PULL 22/36] migration: Report the error returned when save_live_iterate fails, Juan Quintela, 2022/01/28
- [PULL 24/36] migration: Drop dead code of ram_debug_dump_bitmap(), Juan Quintela, 2022/01/28
- [PULL 25/36] migration: Don't return for postcopy_chunk_hostpages(), Juan Quintela, 2022/01/28
- [PULL 23/36] migration/ram: clean up unused comment., Juan Quintela, 2022/01/28
- [PULL 26/36] migration: Drop postcopy_chunk_hostpages(), Juan Quintela, 2022/01/28
- [PULL 28/36] migration: Drop return code for disgard ram process, Juan Quintela, 2022/01/28
- [PULL 27/36] migration: Do chunk page in postcopy_each_ram_send_discard(), Juan Quintela, 2022/01/28
- [PULL 31/36] migration: Tally pre-copy, downtime and post-copy bytes independently, Juan Quintela, 2022/01/28
- [PULL 29/36] migration: Don't return for postcopy_send_discard_bm_ram(), Juan Quintela, 2022/01/28
- [PULL 32/36] migration: No off-by-one for pss->page update in host page size,
Juan Quintela <=
- [PULL 34/36] migration: Add postcopy_has_request(), Juan Quintela, 2022/01/28
- [PULL 35/36] migration: Simplify unqueue_page(), Juan Quintela, 2022/01/28
- [PULL 33/36] migration: Enable UFFD_FEATURE_THREAD_ID even without blocktime feat, Juan Quintela, 2022/01/28
- [PULL 30/36] migration: Introduce ram_transferred_add(), Juan Quintela, 2022/01/28
- [PULL 36/36] migration: Move temp page setup and cleanup into separate functions, Juan Quintela, 2022/01/28
- Re: [PULL 00/36] Migration 20220128 patches, Peter Maydell, 2022/01/30