[PULL 18/22] migration/multifd: Change multifd_load_cleanup() signature and usage

2023-02-12 Thread Xxx Xx
From: Leonardo Bras Since it's introduction in commit f986c3d256 ("migration: Create multifd migration threads"), multifd_load_cleanup() never returned any value different than 0, neither set up any error on errp. Even though, on process_incoming_migration_bh() an if clause uses it's return valu

[PULL 19/22] migration/multifd: Remove unnecessary assignment on multifd_load_cleanup()

2023-02-12 Thread Xxx Xx
From: Leonardo Bras Before assigning "p->quit = true" for every multifd channel, multifd_load_cleanup() will call multifd_recv_terminate_threads() which already does the same assignment, while protected by a mutex. So there is no point doing the same assignment again. Signed-off-by: Leonardo Br

[PULL 06/22] migration: Simplify ram_find_and_save_block()

2023-02-12 Thread Xxx Xx
From: Juan Quintela We will need later that find_dirty_block() return errors, so simplify the loop. Signed-off-by: Juan Quintela Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Juan Quintela --- migration/ram.c | 20 +--- 1 file changed, 9 insertions(+), 11 deletions(-) d

[PULL 08/22] migration: Split ram_bytes_total_common() in two functions

2023-02-12 Thread Xxx Xx
From: Juan Quintela It is just a big if in the middle of the function, and we need two functions anways. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Juan Quintela --- Reindent to make Phillipe happy (and CODING_STYLE) --- migration/ram.c | 25 ++--- 1 file changed

[PULL 11/22] migration: I messed state_pending_exact/estimate

2023-02-12 Thread Xxx Xx
From: Juan Quintela I called the helper function from the wrong top level function. This code was introduced in: commit c8df4a7aeffcb46020f610526eea621fa5b0cd47 Author: Juan Quintela Date: Mon Oct 3 02:00:03 2022 +0200 migration: Split save_live_pending() into state_pending_* We sp

[PULL 10/22] migration: Make ram_save_target_page() a pointer

2023-02-12 Thread Xxx Xx
From: Juan Quintela We are going to create a new function for multifd latest in the series. Signed-off-by: Juan Quintela Reviewed-by: Dr. David Alan Gilbert --- migration/ram.c | 19 +++ 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/migration/ram.c b/migration

[PULL 22/22] ram: Document migration ram flags

2023-02-12 Thread Xxx Xx
From: Juan Quintela 0x80 is RAM_SAVE_FLAG_HOOK, it is in qemu-file now. Bigger usable flag is 0x200, noticing that. We can reuse RAM_SAVe_FLAG_FULL. Reviewed-by: Eric Blake Signed-off-by: Juan Quintela --- migration/ram.c | 16 ++-- 1 file changed, 10 insertions(+), 6 deletions(-)

[PULL 01/22] migration: Remove spurious files

2023-02-12 Thread Xxx Xx
From: Juan Quintela I introduced spurious files on my tree during a rebase: commit ebfc57871506b3fe36cc41f69ee3ad31a34afd63 Author: Zhenzhong Duan Date: Mon Oct 17 15:53:51 2022 +0800 multifd: Fix flush of zero copy page send request Make IO channel flush call after the inflight req

[PULL 20/22] migration/multifd: Join all multifd threads in order to avoid leaks

2023-02-12 Thread Xxx Xx
From: Leonardo Bras Current approach will only join threads that are still running. For the threads not joined, resources or private memory are always kept in the process space and never reclaimed before process end, and this risks serious memory leaks. This should usually not represent a big p

[PULL 13/22] Update bench-code for addressing CI problem

2023-02-12 Thread Xxx Xx
From: ling xu Unit test code is in test-xbzrle.c, and benchmark code is in xbzrle-bench.c for performance benchmarking. we have modified xbzrle-bench.c to address CI problem. Signed-off-by: ling xu Co-authored-by: Zhou Zhao Co-authored-by: Jun Jin Reviewed-by: Juan Quintela Signed-off-by: Ju

[PULL 12/22] AVX512 support for xbzrle_encode_buffer

2023-02-12 Thread Xxx Xx
From: ling xu This commit is the same with [PATCH v6 1/2], and provides avx512 support for xbzrle_encode_buffer function to accelerate xbzrle encoding speed. Runtime check of avx512 support and benchmark for this feature are added. Compared with C version of xbzrle_encode_buffer function, avx512

[PULL 15/22] migration: Cleanup postcopy_preempt_setup()

2023-02-12 Thread Xxx Xx
From: Peter Xu Since we just dropped the only case where postcopy_preempt_setup() can return an error, it doesn't need a retval anymore because it never fails. Move the preempt check to the caller, preparing it to be used elsewhere to do nothing but as simple as kicking the async connection. Sig

[PULL 16/22] migration: Add a semaphore to count PONGs

2023-02-12 Thread Xxx Xx
From: Peter Xu This is mostly useless, but useful for us to know whether the main channel is correctly established without changing the migration protocol. Signed-off-by: Peter Xu Reviewed-by: Juan Quintela Signed-off-by: Juan Quintela --- migration/migration.h | 6 ++ migration/migratio

[PULL 14/22] migration: Rework multi-channel checks on URI

2023-02-12 Thread Xxx Xx
From: Peter Xu The whole idea of multi-channel checks was not properly done, IMHO. Currently we check multi-channel in a lot of places, but actually that's not needed because we only need to check it right after we get the URI and that should be it. If the URI check succeeded, we should never n

[PULL 00/22] Migration 20230213 patches

2023-02-12 Thread Xxx Xx
From: Juan Quintela The following changes since commit 3b33ae48ec28e1e0d1bc28a85c7423724bcb1a2c: Merge tag 'block-pull-request' of https://gitlab.com/stefanha/qemu into staging (2023-02-09 15:29:14 +) are available in the Git repository at: https://gitlab.com/juan.quintela/qemu.git ta

[PULL 05/22] util/userfaultfd: Support /dev/userfaultfd

2023-02-12 Thread Xxx Xx
From: Peter Xu Teach QEMU to use /dev/userfaultfd when it existed and fallback to the system call if either it's not there or doesn't have enough permission. Firstly, as long as the app has permission to access /dev/userfaultfd, it always have the ability to trap kernel faults which QEMU mostly

[PULL 07/22] migration: Make find_dirty_block() return a single parameter

2023-02-12 Thread Xxx Xx
From: Juan Quintela We used to return two bools, just return a single int with the following meaning: old return / again / new return falsefalse PAGE_ALL_CLEAN falsetruePAGE_TRY_AGAIN true truePAGE_DIRTY_FOUND /* We don't care about again at all */ Signed-off-

[PULL 09/22] migration: Calculate ram size once

2023-02-12 Thread Xxx Xx
From: Juan Quintela We are recalculating ram size continously, when we know that it don't change during migration. Create a field in RAMState to track it. Signed-off-by: Juan Quintela Reviewed-by: Philippe Mathieu-Daudé --- migration/ram.c | 7 +-- 1 file changed, 5 insertions(+), 2 dele

[PULL 21/22] migration/multifd: Move load_cleanup inside incoming_state_destroy

2023-02-12 Thread Xxx Xx
From: Leonardo Bras Currently running migration_incoming_state_destroy() without first running multifd_load_cleanup() will cause a yank error: qemu-system-x86_64: ../util/yank.c:107: yank_unregister_instance: Assertion `QLIST_EMPTY(&entry->yankfns)' failed. (core dumped) The above error happens

[PULL 02/22] multifd: cleanup the function multifd_channel_connect

2023-02-12 Thread Xxx Xx
From: Li Zhang Cleanup multifd_channel_connect Signed-off-by: Li Zhang Reviewed-by: Juan Quintela Signed-off-by: Juan Quintela --- migration/multifd.c | 43 +-- 1 file changed, 21 insertions(+), 22 deletions(-) diff --git a/migration/multifd.c b/migra

[PULL 04/22] linux-headers: Update to v6.1

2023-02-12 Thread Xxx Xx
From: Peter Xu Signed-off-by: Peter Xu Reviewed-by: Juan Quintela Acked-by: Cornelia Huck Signed-off-by: Juan Quintela --- include/standard-headers/drm/drm_fourcc.h | 34 - include/standard-headers/linux/ethtool.h | 63 +++- include/standard-headers/linux/fuse.h |

[PULL 03/22] multifd: Remove some redundant code

2023-02-12 Thread Xxx Xx
From: Li Zhang Clean up some unnecessary code Signed-off-by: Li Zhang Signed-off-by: Juan Quintela --- migration/multifd.c | 15 --- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/migration/multifd.c b/migration/multifd.c index c8132ab7e8..7aa030fb19 100644 --- a/m

[PULL 17/22] migration: Postpone postcopy preempt channel to be after main

2023-02-12 Thread Xxx Xx
From: Peter Xu Postcopy with preempt-mode enabled needs two channels to communicate. The order of channel establishment is not guaranteed. It can happen that the dest QEMU got the preempt channel connection request before the main channel is established, then the migration may make no progress