[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 06/19] migration: Add postcopy_preempt_active()
From: |
Juan Quintela |
Subject: |
[PATCH 06/19] migration: Add postcopy_preempt_active() |
Date: |
Mon, 21 Nov 2022 14:27:04 +0100 |
From: Peter Xu <peterx@redhat.com>
Add the helper to show that postcopy preempt enabled, meanwhile active.
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Signed-off-by: Peter Xu <peterx@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
---
migration/ram.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/migration/ram.c b/migration/ram.c
index cc72c24c18..00a2e30322 100644
--- a/migration/ram.c
+++ b/migration/ram.c
@@ -162,6 +162,11 @@ out:
return ret;
}
+static bool postcopy_preempt_active(void)
+{
+ return migrate_postcopy_preempt() && migration_in_postcopy();
+}
+
bool ramblock_is_ignored(RAMBlock *block)
{
return !qemu_ram_is_migratable(block) ||
@@ -2433,7 +2438,7 @@ static void postcopy_preempt_choose_channel(RAMState *rs,
PageSearchStatus *pss)
/* We need to make sure rs->f always points to the default channel elsewhere */
static void postcopy_preempt_reset_channel(RAMState *rs)
{
- if (migrate_postcopy_preempt() && migration_in_postcopy()) {
+ if (postcopy_preempt_active()) {
rs->postcopy_channel = RAM_CHANNEL_PRECOPY;
rs->f = migrate_get_current()->to_dst_file;
trace_postcopy_preempt_reset_channel();
@@ -2471,7 +2476,7 @@ static int ram_save_host_page(RAMState *rs,
PageSearchStatus *pss)
return 0;
}
- if (migrate_postcopy_preempt() && migration_in_postcopy()) {
+ if (postcopy_preempt_active()) {
postcopy_preempt_choose_channel(rs, pss);
}
--
2.38.1
- [PATCH 04/19] migration: Export ram_release_page(), (continued)
- [PATCH 04/19] migration: Export ram_release_page(), Juan Quintela, 2022/11/21
- [PATCH 08/19] migration: Trivial cleanup save_page_header() on same block check, Juan Quintela, 2022/11/21
- [PATCH 05/19] migration: Take bitmap mutex when completing ram migration, Juan Quintela, 2022/11/21
- [PATCH 16/19] migration: Move last_sent_block into PageSearchStatus, Juan Quintela, 2022/11/21
- [PATCH 07/19] migration: Cleanup xbzrle zero page cache update logic, Juan Quintela, 2022/11/21
- [PATCH 14/19] migration: Add pss_init(), Juan Quintela, 2022/11/21
- [PATCH 18/19] migration: Remove old preempt code around state maintainance, Juan Quintela, 2022/11/21
- [PATCH 10/19] migration: Yield bitmap_mutex properly when sending/sleeping, Juan Quintela, 2022/11/21
- [PATCH 12/19] migration: Teach PSS about host page, Juan Quintela, 2022/11/21
- [PATCH 03/19] migration: Export ram_transferred_ram(), Juan Quintela, 2022/11/21
- [PATCH 06/19] migration: Add postcopy_preempt_active(),
Juan Quintela <=
- [PATCH 02/19] multifd: Create page_count fields into both MultiFD{Recv, Send}Params, Juan Quintela, 2022/11/21
- [PATCH 11/19] migration: Use atomic ops properly for page accountings, Juan Quintela, 2022/11/21
- [PATCH 01/19] multifd: Create page_size fields into both MultiFD{Recv, Send}Params, Juan Quintela, 2022/11/21
- [PATCH 09/19] migration: Remove RAMState.f references in compression code, Juan Quintela, 2022/11/21
- [PATCH 15/19] migration: Make PageSearchStatus part of RAMState, Juan Quintela, 2022/11/21
- [PATCH 13/19] migration: Introduce pss_channel, Juan Quintela, 2022/11/21
- [PATCH 17/19] migration: Send requested page directly in rp-return thread, Juan Quintela, 2022/11/21
- [PATCH 19/19] migration: Drop rs->f, Juan Quintela, 2022/11/21
- Re: [PATCH 00/19] Migration patches for 8.8, Juan Quintela, 2022/11/21