qemu-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-commits] [qemu/qemu] 672159: migration/ram.c: Remove the qemu_mute


From: Richard Henderson
Subject: [Qemu-commits] [qemu/qemu] 672159: migration/ram.c: Remove the qemu_mutex_lock in col...
Date: Wed, 15 Dec 2021 09:21:01 -0800

  Branch: refs/heads/staging
  Home:   https://github.com/qemu/qemu
  Commit: 672159a97ce7c1ca2b97bfef439d7994f79b1c61
      
https://github.com/qemu/qemu/commit/672159a97ce7c1ca2b97bfef439d7994f79b1c61
  Author: Rao, Lei <lei.rao@intel.com>
  Date:   2021-12-15 (Wed, 15 Dec 2021)

  Changed paths:
    M migration/ram.c

  Log Message:
  -----------
  migration/ram.c: Remove the qemu_mutex_lock in colo_flush_ram_cache.

The code to acquire bitmap_mutex is added in the commit of
"63268c4970a5f126cc9af75f3ccb8057abef5ec0". There is no
need to acquire bitmap_mutex in colo_flush_ram_cache(). This
is because the colo_flush_ram_cache only be called on the COLO
secondary VM, which is the destination side.
On the COLO secondary VM, only the COLO thread will touch
the bitmap of ram cache.

Signed-off-by: Lei Rao <lei.rao@intel.com>
Reviewed-by: Zhang Chen <chen.zhang@intel.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>


  Commit: 0e0f0479e28c6c1a1d024b2e5200cade479d6901
      
https://github.com/qemu/qemu/commit/0e0f0479e28c6c1a1d024b2e5200cade479d6901
  Author: Zhang Chen <chen.zhang@intel.com>
  Date:   2021-12-15 (Wed, 15 Dec 2021)

  Changed paths:
    M migration/colo.c

  Log Message:
  -----------
  migration/colo: More accurate update checkpoint time

Previous operation(like vm_start and replication_start_all) will consume
extra time before update the timer, so reduce time in this patch.

Signed-off-by: Zhang Chen <chen.zhang@intel.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>


  Commit: 795969ab1fe6d5a0f524be92e2e1ecd13f1873eb
      
https://github.com/qemu/qemu/commit/795969ab1fe6d5a0f524be92e2e1ecd13f1873eb
  Author: Rao, Lei <lei.rao@intel.com>
  Date:   2021-12-15 (Wed, 15 Dec 2021)

  Changed paths:
    M include/migration/colo.h
    M migration/colo.c
    M migration/migration.c

  Log Message:
  -----------
  Fixed a QEMU hang when guest poweroff in COLO mode

When the PVM guest poweroff, the COLO thread may wait a semaphore
in colo_process_checkpoint().So, we should wake up the COLO thread
before migration shutdown.

Signed-off-by: Lei Rao <lei.rao@intel.com>
Reviewed-by: Zhang Chen <chen.zhang@intel.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>


  Commit: 751fe4c608b6e83ea3c19fff2bdbea19645c398f
      
https://github.com/qemu/qemu/commit/751fe4c608b6e83ea3c19fff2bdbea19645c398f
  Author: Zhang Chen <chen.zhang@intel.com>
  Date:   2021-12-15 (Wed, 15 Dec 2021)

  Changed paths:
    M migration/colo.c
    M migration/migration.c

  Log Message:
  -----------
  migration/colo: Optimize COLO primary node start code path

Optimize COLO primary start path from:
MIGRATION_STATUS_XXX --> MIGRATION_STATUS_ACTIVE --> MIGRATION_STATUS_COLO --> 
MIGRATION_STATUS_COMPLETED
To:
MIGRATION_STATUS_XXX --> MIGRATION_STATUS_COLO --> MIGRATION_STATUS_COMPLETED
No need to start primary COLO through "MIGRATION_STATUS_ACTIVE".

Signed-off-by: Zhang Chen <chen.zhang@intel.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>


  Commit: bad452a77e017dca97200e94f661e7a563dc6426
      
https://github.com/qemu/qemu/commit/bad452a77e017dca97200e94f661e7a563dc6426
  Author: Juan Quintela <quintela@redhat.com>
  Date:   2021-12-15 (Wed, 15 Dec 2021)

  Changed paths:
    M migration/ram.c

  Log Message:
  -----------
  migration: Remove is_zero_range()

It just calls buffer_is_zero().  Just change the callers.

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>


  Commit: f13f22badc6767ea160bb77ee09830d44107b36b
      
https://github.com/qemu/qemu/commit/f13f22badc6767ea160bb77ee09830d44107b36b
  Author: Juan Quintela <quintela@redhat.com>
  Date:   2021-12-15 (Wed, 15 Dec 2021)

  Changed paths:
    M dump/dump.c

  Log Message:
  -----------
  dump: Remove is_zero_page()

It just calls buffer_is_zero().  Just change the callers.

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>


  Commit: 47a17824613fc88b938f4fd9585931e03517f440
      
https://github.com/qemu/qemu/commit/47a17824613fc88b938f4fd9585931e03517f440
  Author: Juan Quintela <quintela@redhat.com>
  Date:   2021-12-15 (Wed, 15 Dec 2021)

  Changed paths:
    M migration/multifd-zlib.c
    M migration/multifd-zstd.c

  Log Message:
  -----------
  multifd: Delete useless operation

We are dividing by page_size to multiply again in the only use.
Once there, improve the comments.

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>


  Commit: 144fa06b3431e806057ce1438338395b35a3e544
      
https://github.com/qemu/qemu/commit/144fa06b3431e806057ce1438338395b35a3e544
  Author: Juan Quintela <quintela@redhat.com>
  Date:   2021-12-15 (Wed, 15 Dec 2021)

  Changed paths:
    M migration/migration.c
    M migration/multifd.c
    M migration/savevm.c

  Log Message:
  -----------
  migration: Never call twice qemu_target_page_size()

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>


  Commit: 90a3d2f9d5f729147b2827c177932603ae6e2d55
      
https://github.com/qemu/qemu/commit/90a3d2f9d5f729147b2827c177932603ae6e2d55
  Author: Juan Quintela <quintela@redhat.com>
  Date:   2021-12-15 (Wed, 15 Dec 2021)

  Changed paths:
    M migration/multifd.c
    M migration/multifd.h

  Log Message:
  -----------
  multifd: Rename used field to num

We will need to split it later in zero_num (number of zero pages) and
normal_num (number of normal pages).  This name is better.

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>


  Commit: 18ede636bc29fd8bda628fe3e5c593f8c1b734f4
      
https://github.com/qemu/qemu/commit/18ede636bc29fd8bda628fe3e5c593f8c1b734f4
  Author: Juan Quintela <quintela@redhat.com>
  Date:   2021-12-15 (Wed, 15 Dec 2021)

  Changed paths:
    M migration/multifd-zlib.c
    M migration/multifd-zstd.c
    M migration/multifd.c

  Log Message:
  -----------
  multifd: Add missing documention

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>


  Commit: 1943c11a62bd0741e5d9fbba78404fe47ebea820
      
https://github.com/qemu/qemu/commit/1943c11a62bd0741e5d9fbba78404fe47ebea820
  Author: Juan Quintela <quintela@redhat.com>
  Date:   2021-12-15 (Wed, 15 Dec 2021)

  Changed paths:
    M migration/multifd.c

  Log Message:
  -----------
  multifd: The variable is only used inside the loop

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>


  Commit: 02fb81043ecee338e4aeb8f5be09a46325dc5e43
      
https://github.com/qemu/qemu/commit/02fb81043ecee338e4aeb8f5be09a46325dc5e43
  Author: Juan Quintela <quintela@redhat.com>
  Date:   2021-12-15 (Wed, 15 Dec 2021)

  Changed paths:
    M migration/multifd-zlib.c
    M migration/multifd-zstd.c
    M migration/multifd.c
    M migration/multifd.h

  Log Message:
  -----------
  multifd: remove used parameter from send_prepare() method

It is already there as p->pages->num.

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>


  Commit: 40a4bfe9d3f8ad35a9c3ffb4cbf7367e2777054b
      
https://github.com/qemu/qemu/commit/40a4bfe9d3f8ad35a9c3ffb4cbf7367e2777054b
  Author: Juan Quintela <quintela@redhat.com>
  Date:   2021-12-15 (Wed, 15 Dec 2021)

  Changed paths:
    M migration/multifd-zlib.c
    M migration/multifd-zstd.c
    M migration/multifd.c
    M migration/multifd.h

  Log Message:
  -----------
  multifd: remove used parameter from send_recv_pages() method

It is already there as p->pages->num.

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>


  Commit: 01102a2ef6c97acc5cc8a2c3bb62b7665a20f51f
      
https://github.com/qemu/qemu/commit/01102a2ef6c97acc5cc8a2c3bb62b7665a20f51f
  Author: Juan Quintela <quintela@redhat.com>
  Date:   2021-12-15 (Wed, 15 Dec 2021)

  Changed paths:
    M migration/multifd.c

  Log Message:
  -----------
  multifd: Fill offset and block for reception

We were using the iov directly, but we will need this info on the
following patch.

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>


  Commit: 077fbb5942b56826f731de16caae3122a30aab22
      
https://github.com/qemu/qemu/commit/077fbb5942b56826f731de16caae3122a30aab22
  Author: Li Zhang <lizhang@suse.de>
  Date:   2021-12-15 (Wed, 15 Dec 2021)

  Changed paths:
    M migration/multifd.c

  Log Message:
  -----------
  multifd: Shut down the QIO channels to avoid blocking the send threads when 
they are terminated.

When doing live migration with multifd channels 8, 16 or larger number,
the guest hangs in the presence of the network errors such as missing TCP ACKs.

At sender's side:
The main thread is blocked on qemu_thread_join, migration_fd_cleanup
is called because one thread fails on qio_channel_write_all when
the network problem happens and other send threads are blocked on sendmsg.
They could not be terminated. So the main thread is blocked on qemu_thread_join
to wait for the threads terminated.

(gdb) bt
0  0x00007f30c8dcffc0 in __pthread_clockjoin_ex () at /lib64/libpthread.so.0
1  0x000055cbb716084b in qemu_thread_join (thread=0x55cbb881f418) at 
../util/qemu-thread-posix.c:627
2  0x000055cbb6b54e40 in multifd_save_cleanup () at ../migration/multifd.c:542
3  0x000055cbb6b4de06 in migrate_fd_cleanup (s=0x55cbb8024000) at 
../migration/migration.c:1808
4  0x000055cbb6b4dfb4 in migrate_fd_cleanup_bh (opaque=0x55cbb8024000) at 
../migration/migration.c:1850
5  0x000055cbb7173ac1 in aio_bh_call (bh=0x55cbb7eb98e0) at ../util/async.c:141
6  0x000055cbb7173bcb in aio_bh_poll (ctx=0x55cbb7ebba80) at ../util/async.c:169
7  0x000055cbb715ba4b in aio_dispatch (ctx=0x55cbb7ebba80) at 
../util/aio-posix.c:381
8  0x000055cbb7173ffe in aio_ctx_dispatch (source=0x55cbb7ebba80, callback=0x0, 
user_data=0x0) at ../util/async.c:311
9  0x00007f30c9c8cdf4 in g_main_context_dispatch () at 
/usr/lib64/libglib-2.0.so.0
10 0x000055cbb71851a2 in glib_pollfds_poll () at ../util/main-loop.c:232
11 0x000055cbb718521c in os_host_main_loop_wait (timeout=42251070366) at 
../util/main-loop.c:255
12 0x000055cbb7185321 in main_loop_wait (nonblocking=0) at 
../util/main-loop.c:531
13 0x000055cbb6e6ba27 in qemu_main_loop () at ../softmmu/runstate.c:726
14 0x000055cbb6ad6fd7 in main (argc=68, argv=0x7ffc0c578888, 
envp=0x7ffc0c578ab0) at ../softmmu/main.c:50

To make sure that the send threads could be terminated, IO channels should be
shut down to avoid waiting IO.

Signed-off-by: Li Zhang <lizhang@suse.de>
Reviewed-by: Daniel P. Berrangé <berrange@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>


  Commit: 9c5c8ff24e2cc9b4db76c33aa360563407832656
      
https://github.com/qemu/qemu/commit/9c5c8ff24e2cc9b4db76c33aa360563407832656
  Author: Rao, Lei <lei.rao@intel.com>
  Date:   2021-12-15 (Wed, 15 Dec 2021)

  Changed paths:
    M migration/colo.c

  Log Message:
  -----------
  COLO: Move some trace code behind qemu_mutex_unlock_iothread()

There is no need to put some trace code in the critical section.
So, moving it behind qemu_mutex_unlock_iothread() can reduce the
lock time.

Signed-off-by: Lei Rao <lei.rao@intel.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>


  Commit: f5ff548774c22b34a0c0e2fef85f1be11160d774
      
https://github.com/qemu/qemu/commit/f5ff548774c22b34a0c0e2fef85f1be11160d774
  Author: Juan Quintela <quintela@redhat.com>
  Date:   2021-12-15 (Wed, 15 Dec 2021)

  Changed paths:
    M migration/multifd-zstd.c

  Log Message:
  -----------
  multifd: Make zstd compression method not use iovs

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>


  Commit: a5ed22948873b50fcf1415d1ce15c71d61a9388d
      
https://github.com/qemu/qemu/commit/a5ed22948873b50fcf1415d1ce15c71d61a9388d
  Author: Juan Quintela <quintela@redhat.com>
  Date:   2021-12-15 (Wed, 15 Dec 2021)

  Changed paths:
    M migration/multifd-zlib.c

  Log Message:
  -----------
  multifd: Make zlib compression method not use iovs

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>


  Commit: 0da6106883565c40a653027b9dfee2df8e6f8ef6
      
https://github.com/qemu/qemu/commit/0da6106883565c40a653027b9dfee2df8e6f8ef6
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2021-12-15 (Wed, 15 Dec 2021)

  Changed paths:
    M dump/dump.c
    M include/migration/colo.h
    M migration/colo.c
    M migration/migration.c
    M migration/multifd-zlib.c
    M migration/multifd-zstd.c
    M migration/multifd.c
    M migration/multifd.h
    M migration/ram.c
    M migration/savevm.c

  Log Message:
  -----------
  Merge tag 'migration-20211214-pull-request' of 
https://gitlab.com/juan.quintela/qemu into staging

Migration Pull request

Hi

This are the reviewed patches for the freeze period:

- colo: fix/optimize several things (rao, chen)
- shutdown qio channels correctly when an error happens (li)
- serveral multifd patches for the zero series (me)

Please apply.

Thanks, Juan.

# gpg: Signature made Wed 15 Dec 2021 02:32:09 AM PST
# gpg:                using RSA key 1899FF8EDEBF58CCEE034B82F487EF185872D723
# gpg: Good signature from "Juan Quintela <quintela@redhat.com>" [full]
# gpg:                 aka "Juan Quintela <quintela@trasno.org>" [full]

* tag 'migration-20211214-pull-request' of 
https://gitlab.com/juan.quintela/qemu:
  multifd: Make zlib compression method not use iovs
  multifd: Make zstd compression method not use iovs
  COLO: Move some trace code behind qemu_mutex_unlock_iothread()
  multifd: Shut down the QIO channels to avoid blocking the send threads when 
they are terminated.
  multifd: Fill offset and block for reception
  multifd: remove used parameter from send_recv_pages() method
  multifd: remove used parameter from send_prepare() method
  multifd: The variable is only used inside the loop
  multifd: Add missing documention
  multifd: Rename used field to num
  migration: Never call twice qemu_target_page_size()
  multifd: Delete useless operation
  dump: Remove is_zero_page()
  migration: Remove is_zero_range()
  migration/colo: Optimize COLO primary node start code path
  Fixed a QEMU hang when guest poweroff in COLO mode
  migration/colo: More accurate update checkpoint time
  migration/ram.c: Remove the qemu_mutex_lock in colo_flush_ram_cache.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>


Compare: https://github.com/qemu/qemu/compare/5d3da09e44a7...0da610688356



reply via email to

[Prev in Thread] Current Thread [Next in Thread]