[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH RFC 02/15] migration: Allow pss->page jump over clean pages
|
From: |
Peter Xu |
|
Subject: |
[PATCH RFC 02/15] migration: Allow pss->page jump over clean pages |
|
Date: |
Wed, 19 Jan 2022 16:09:16 +0800 |
Commit ba1b7c812c ("migration/ram: Optimize ram_save_host_page()") managed to
optimize host huge page use case by scanning the dirty bitmap when looking for
the next dirty small page to migrate.
However when updating the pss->page before returning from that function, we
used MIN() of these two values: (1) next dirty bit, or (2) end of current sent
huge page, to fix up pss->page.
That sounds unnecessary, because I see nowhere that requires pss->page to be
not going over current huge page boundary.
What we need here is probably MAX() instead of MIN() so that we'll start
scanning from the next dirty bit next time. Since pss->page can't be smaller
than hostpage_boundary (the loop guarantees it), it probably means we don't
need to fix it up at all.
Cc: Keqian Zhu <zhukeqian1@huawei.com>
Cc: Kunkun Jiang <jiangkunkun@huawei.com>
Signed-off-by: Peter Xu <peterx@redhat.com>
---
migration/ram.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/migration/ram.c b/migration/ram.c
index 381ad56d26..94b0ad4234 100644
--- a/migration/ram.c
+++ b/migration/ram.c
@@ -2229,8 +2229,6 @@ static int ram_save_host_page(RAMState *rs,
PageSearchStatus *pss,
} while ((pss->page < hostpage_boundary) &&
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);
res = ram_save_release_protection(rs, pss, start_page);
return (res < 0 ? res : pages);
--
2.32.0
- [PATCH RFC 00/15] migration: Postcopy Preemption, Peter Xu, 2022/01/19
- [PATCH RFC 01/15] migration: No off-by-one for pss->page update in host page size, Peter Xu, 2022/01/19
- [PATCH RFC 03/15] migration: Enable UFFD_FEATURE_THREAD_ID even without blocktime feat, Peter Xu, 2022/01/19
- [PATCH RFC 02/15] migration: Allow pss->page jump over clean pages,
Peter Xu <=
- [PATCH RFC 04/15] migration: Add postcopy_has_request(), Peter Xu, 2022/01/19
- [PATCH RFC 05/15] migration: Simplify unqueue_page(), Peter Xu, 2022/01/19
- Re: [PATCH RFC 05/15] migration: Simplify unqueue_page(), Juan Quintela, 2022/01/27