[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 16/30] migration: Add postcopy_preempt_active()
From: |
Juan Quintela |
Subject: |
[PATCH 16/30] migration: Add postcopy_preempt_active() |
Date: |
Tue, 15 Nov 2022 13:12:12 +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 96fa521813..52c851eb56 100644
--- a/migration/ram.c
+++ b/migration/ram.c
@@ -190,6 +190,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) ||
@@ -2461,7 +2466,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();
@@ -2499,7 +2504,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 07/30] migration: Export ram_release_page(), (continued)
- [PATCH 07/30] migration: Export ram_release_page(), Juan Quintela, 2022/11/15
- [PATCH 06/30] migration: Export ram_transferred_ram(), Juan Quintela, 2022/11/15
- [PATCH 09/30] Unit test code and benchmark code, Juan Quintela, 2022/11/15
- [PATCH 12/30] migration: Disallow postcopy preempt to be used with compress, Juan Quintela, 2022/11/15
- [PATCH 10/30] migration: Fix possible infinite loop of ram save process, Juan Quintela, 2022/11/15
- [PATCH 11/30] migration: Fix race on qemu_file_shutdown(), Juan Quintela, 2022/11/15
- [PATCH 08/30] Update AVX512 support for xbzrle_encode_buffer, Juan Quintela, 2022/11/15
- [PATCH 13/30] migration: Use non-atomic ops for clear log bitmap, Juan Quintela, 2022/11/15
- [PATCH 15/30] migration: Take bitmap mutex when completing ram migration, Juan Quintela, 2022/11/15
- [PATCH 14/30] migration: Disable multifd explicitly with compression, Juan Quintela, 2022/11/15
- [PATCH 16/30] migration: Add postcopy_preempt_active(),
Juan Quintela <=
- [PATCH 17/30] migration: Cleanup xbzrle zero page cache update logic, Juan Quintela, 2022/11/15
- [PATCH 18/30] migration: Trivial cleanup save_page_header() on same block check, Juan Quintela, 2022/11/15
- [PATCH 19/30] migration: Remove RAMState.f references in compression code, Juan Quintela, 2022/11/15
- [PATCH 20/30] migration: Yield bitmap_mutex properly when sending/sleeping, Juan Quintela, 2022/11/15
- [PATCH 22/30] migration: Teach PSS about host page, Juan Quintela, 2022/11/15
- [PATCH 21/30] migration: Use atomic ops properly for page accountings, Juan Quintela, 2022/11/15
- [PATCH 25/30] migration: Make PageSearchStatus part of RAMState, Juan Quintela, 2022/11/15
- [PATCH 23/30] migration: Introduce pss_channel, Juan Quintela, 2022/11/15
- [PATCH 24/30] migration: Add pss_init(), Juan Quintela, 2022/11/15
- [PATCH 27/30] migration: Send requested page directly in rp-return thread, Juan Quintela, 2022/11/15