qemu-commits
[Top][All Lists]
Advanced

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

[Qemu-commits] [qemu/qemu] 8ebb6e: migration: remove extra whitespace ch


From: Richard Henderson
Subject: [Qemu-commits] [qemu/qemu] 8ebb6e: migration: remove extra whitespace character for c...
Date: Mon, 24 Apr 2023 05:41:40 -0700

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: 8ebb6ecc3798e66a9ba98355983762bedfa1b72d
      
https://github.com/qemu/qemu/commit/8ebb6ecc3798e66a9ba98355983762bedfa1b72d
  Author: 李皆俊 <a_lijiejun@163.com>
  Date:   2023-04-24 (Mon, 24 Apr 2023)

  Changed paths:
    M migration/ram.c

  Log Message:
  -----------
  migration: remove extra whitespace character for code style

Fix code style.

Signed-off-by: 李皆俊 <a_lijiejun@163.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>


  Commit: abce5fa16d126ed085ccf8a5b3fe61a1efa20994
      
https://github.com/qemu/qemu/commit/abce5fa16d126ed085ccf8a5b3fe61a1efa20994
  Author: Juan Quintela <quintela@redhat.com>
  Date:   2023-04-24 (Mon, 24 Apr 2023)

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

  Log Message:
  -----------
  migration: Merge ram_counters and ram_atomic_counters

Using MgrationStats as type for ram_counters mean that we didn't have
to re-declare each value in another struct. The need of atomic
counters have make us to create MigrationAtomicStats for this atomic
counters.

Create RAMStats type which is a merge of MigrationStats and
MigrationAtomicStats removing unused members.

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Peter Xu <peterx@redhat.com>

---

Fix typos found by David Edmondson


  Commit: 30fb22cda45bea43a3c0e26049ebdd71a9503ffd
      
https://github.com/qemu/qemu/commit/30fb22cda45bea43a3c0e26049ebdd71a9503ffd
  Author: Juan Quintela <quintela@redhat.com>
  Date:   2023-04-24 (Mon, 24 Apr 2023)

  Changed paths:
    M migration/multifd.c

  Log Message:
  -----------
  migration: Update atomic stats out of the mutex

Reviewed-by: David Edmondson <david.edmondson@oracle.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>


  Commit: cf671116facf4e29d91fce9c9ffb535385ffac81
      
https://github.com/qemu/qemu/commit/cf671116facf4e29d91fce9c9ffb535385ffac81
  Author: Juan Quintela <quintela@redhat.com>
  Date:   2023-04-24 (Mon, 24 Apr 2023)

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

  Log Message:
  -----------
  migration: Make multifd_bytes atomic

In the spirit of:

commit 394d323bc3451e4d07f13341cb8817fac8dfbadd
Author: Peter Xu <peterx@redhat.com>
Date:   Tue Oct 11 17:55:51 2022 -0400

    migration: Use atomic ops properly for page accountings

Reviewed-by: David Edmondson <david.edmondson@oracle.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>


  Commit: 4291823694fd8507831d26e2558d9cd0030841f7
      
https://github.com/qemu/qemu/commit/4291823694fd8507831d26e2558d9cd0030841f7
  Author: Juan Quintela <quintela@redhat.com>
  Date:   2023-04-24 (Mon, 24 Apr 2023)

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

  Log Message:
  -----------
  migration: Make dirty_sync_missed_zero_copy atomic

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Peter Xu <peterx@redhat.com>


  Commit: b013b5d1f32ef88457e66c7ce576f6475238f97f
      
https://github.com/qemu/qemu/commit/b013b5d1f32ef88457e66c7ce576f6475238f97f
  Author: Juan Quintela <quintela@redhat.com>
  Date:   2023-04-24 (Mon, 24 Apr 2023)

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

  Log Message:
  -----------
  migration: Make precopy_bytes atomic

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Peter Xu <peterx@redhat.com>


  Commit: 296a4ac2aa63038b6b702f2ee8f0f93ae26727ae
      
https://github.com/qemu/qemu/commit/296a4ac2aa63038b6b702f2ee8f0f93ae26727ae
  Author: Juan Quintela <quintela@redhat.com>
  Date:   2023-04-24 (Mon, 24 Apr 2023)

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

  Log Message:
  -----------
  migration: Make downtime_bytes atomic

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Peter Xu <peterx@redhat.com>


  Commit: 536b5a4e56ec67c958f46e7d46cbd5ac34e5a239
      
https://github.com/qemu/qemu/commit/536b5a4e56ec67c958f46e7d46cbd5ac34e5a239
  Author: Juan Quintela <quintela@redhat.com>
  Date:   2023-04-24 (Mon, 24 Apr 2023)

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

  Log Message:
  -----------
  migration: Make dirty_sync_count atomic

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Peter Xu <peterx@redhat.com>


  Commit: 3c764f9b2bc3e5eb5ed93ab45c2de6d599fef00f
      
https://github.com/qemu/qemu/commit/3c764f9b2bc3e5eb5ed93ab45c2de6d599fef00f
  Author: Juan Quintela <quintela@redhat.com>
  Date:   2023-04-24 (Mon, 24 Apr 2023)

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

  Log Message:
  -----------
  migration: Make postcopy_requests atomic

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Peter Xu <peterx@redhat.com>


  Commit: 1a386e8de5995fb5478ea99baa6d3e71abcf4b80
      
https://github.com/qemu/qemu/commit/1a386e8de5995fb5478ea99baa6d3e71abcf4b80
  Author: Juan Quintela <quintela@redhat.com>
  Date:   2023-04-24 (Mon, 24 Apr 2023)

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

  Log Message:
  -----------
  migration: Rename duplicate to zero_pages

Rest of counters that refer to pages has a _pages suffix.
And historically, this showed the number of pages composed of the same
character, here comes the name "duplicated".  But since years ago, it
refers to the number of zero_pages.

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Peter Xu <peterx@redhat.com>


  Commit: 8c0cda8fa0de0a50148e2c60552afca9cffca643
      
https://github.com/qemu/qemu/commit/8c0cda8fa0de0a50148e2c60552afca9cffca643
  Author: Juan Quintela <quintela@redhat.com>
  Date:   2023-04-24 (Mon, 24 Apr 2023)

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

  Log Message:
  -----------
  migration: Rename normal to normal_pages

Rest of counters that refer to pages has a _pages suffix.
And historically, this showed the number of full pages transferred.
The name "normal" refered to the fact that they were sent without any
optimization (compression, xbzrle, zero_page, ...).

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Peter Xu <peterx@redhat.com>


  Commit: 403d18ae384239876764bbfa111d6cc5dcb673d1
      
https://github.com/qemu/qemu/commit/403d18ae384239876764bbfa111d6cc5dcb673d1
  Author: Eric Blake <eblake@redhat.com>
  Date:   2023-04-24 (Mon, 24 Apr 2023)

  Changed paths:
    M migration/migration.c

  Log Message:
  -----------
  migration: Handle block device inactivation failures better

Consider what happens when performing a migration between two host
machines connected to an NFS server serving multiple block devices to
the guest, when the NFS server becomes unavailable.  The migration
attempts to inactivate all block devices on the source (a necessary
step before the destination can take over); but if the NFS server is
non-responsive, the attempt to inactivate can itself fail.  When that
happens, the destination fails to get the migrated guest (good,
because the source wasn't able to flush everything properly):

  (qemu) qemu-kvm: load of migration failed: Input/output error

at which point, our only hope for the guest is for the source to take
back control.  With the current code base, the host outputs a message, but then 
appears to resume:

  (qemu) qemu-kvm: qemu_savevm_state_complete_precopy_non_iterable: 
bdrv_inactivate_all() failed (-1)

  (src qemu)info status
   VM status: running

but a second migration attempt now asserts:

  (src qemu) qemu-kvm: ../block.c:6738: int 
bdrv_inactivate_recurse(BlockDriverState *): Assertion `!(bs->open_flags & 
BDRV_O_INACTIVE)' failed.

Whether the guest is recoverable on the source after the first failure
is debatable, but what we do not want is to have qemu itself fail due
to an assertion.  It looks like the problem is as follows:

In migration.c:migration_completion(), the source sets 'inactivate' to
true (since COLO is not enabled), then tries
savevm.c:qemu_savevm_state_complete_precopy() with a request to
inactivate block devices.  In turn, this calls
block.c:bdrv_inactivate_all(), which fails when flushing runs up
against the non-responsive NFS server.  With savevm failing, we are
now left in a state where some, but not all, of the block devices have
been inactivated; but migration_completion() then jumps to 'fail'
rather than 'fail_invalidate' and skips an attempt to reclaim those
those disks by calling bdrv_activate_all().  Even if we do attempt to
reclaim disks, we aren't taking note of failure there, either.

Thus, we have reached a state where the migration engine has forgotten
all state about whether a block device is inactive, because we did not
set s->block_inactive in enough places; so migration allows the source
to reach vm_start() and resume execution, violating the block layer
invariant that the guest CPUs should not be restarted while a device
is inactive.  Note that the code in migration.c:migrate_fd_cancel()
will also try to reactivate all block devices if s->block_inactive was
set, but because we failed to set that flag after the first failure,
the source assumes it has reclaimed all devices, even though it still
has remaining inactivated devices and does not try again.  Normally,
qmp_cont() will also try to reactivate all disks (or correctly fail if
the disks are not reclaimable because NFS is not yet back up), but the
auto-resumption of the source after a migration failure does not go
through qmp_cont().  And because we have left the block layer in an
inconsistent state with devices still inactivated, the later migration
attempt is hitting the assertion failure.

Since it is important to not resume the source with inactive disks,
this patch marks s->block_inactive before attempting inactivation,
rather than after succeeding, in order to prevent any vm_start() until
it has successfully reactivated all devices.

See also https://bugzilla.redhat.com/show_bug.cgi?id=2058982

Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Acked-by: Lukas Straub <lukasstraub2@web.de>
Tested-by: Lukas Straub <lukasstraub2@web.de>
Signed-off-by: Juan Quintela <quintela@redhat.com>


  Commit: fa45f8dab9613993c042176ea2d25552bfebc955
      
https://github.com/qemu/qemu/commit/fa45f8dab9613993c042176ea2d25552bfebc955
  Author: Peter Xu <peterx@redhat.com>
  Date:   2023-04-24 (Mon, 24 Apr 2023)

  Changed paths:
    M include/qemu/mmap-alloc.h
    M util/mmap-alloc.c

  Log Message:
  -----------
  util/mmap-alloc: qemu_fd_getfs()

This new helper fetches file system type for a fd.  Only Linux is
implemented so far.  Currently only tmpfs and hugetlbfs are defined,
but it can grow as needed.

Signed-off-by: Peter Xu <peterx@redhat.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>


  Commit: cb9d8b8ce1aaf38f53295fc59ec1b8b7eb4338d2
      
https://github.com/qemu/qemu/commit/cb9d8b8ce1aaf38f53295fc59ec1b8b7eb4338d2
  Author: Peter Xu <peterx@redhat.com>
  Date:   2023-04-24 (Mon, 24 Apr 2023)

  Changed paths:
    M softmmu/vl.c

  Log Message:
  -----------
  vl.c: Create late backends before migration object

The migration object may want to check against different types of memory
when initialized.  Delay the creation to be after late backends.

Signed-off-by: Peter Xu <peterx@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>


  Commit: ae30b9b2892b85e6c3d5c0b8d1949c4d77a2954a
      
https://github.com/qemu/qemu/commit/ae30b9b2892b85e6c3d5c0b8d1949c4d77a2954a
  Author: Peter Xu <peterx@redhat.com>
  Date:   2023-04-24 (Mon, 24 Apr 2023)

  Changed paths:
    M migration/postcopy-ram.c

  Log Message:
  -----------
  migration/postcopy: Detect file system on dest host

Postcopy requires the memory support userfaultfd to work.  Right now we
check it but it's a bit too late (when switching to postcopy migration).

Do that early right at enabling of postcopy.

Note that this is still only a best effort because ramblocks can be
dynamically created.  We can add check in hostmem creations and fail if
postcopy enabled, but maybe that's too aggressive.

Still, we have chance to fail the most obvious where we know there's an
existing unsupported ramblock.

Signed-off-by: Peter Xu <peterx@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>


  Commit: 0cec2056ff67557c18d7b8ab1b70ab47c9e31f2f
      
https://github.com/qemu/qemu/commit/0cec2056ff67557c18d7b8ab1b70ab47c9e31f2f
  Author: Juan Quintela <quintela@redhat.com>
  Date:   2023-04-24 (Mon, 24 Apr 2023)

  Changed paths:
    M migration/migration.c
    M migration/migration.h
    M migration/rdma.c
    M migration/savevm.c

  Log Message:
  -----------
  migration: rename enabled_capabilities to capabilities

It is clear from the context what that means, and such a long name
with the extra long names of the capabilities make very difficilut to
stay inside the 80 columns limit.

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>


  Commit: b02c7fc9ef447787414e6fa67eff75e7b7b30180
      
https://github.com/qemu/qemu/commit/b02c7fc9ef447787414e6fa67eff75e7b7b30180
  Author: Juan Quintela <quintela@redhat.com>
  Date:   2023-04-24 (Mon, 24 Apr 2023)

  Changed paths:
    M migration/migration.c

  Log Message:
  -----------
  migration: Pass migrate_caps_check() the old and new caps

We used to pass the old capabilities array and the new
capabilities as a list.

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>


  Commit: 81072abf1575b11226b3779af76dc71dfa85ee5d
      
https://github.com/qemu/qemu/commit/81072abf1575b11226b3779af76dc71dfa85ee5d
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2023-04-24 (Mon, 24 Apr 2023)

  Changed paths:
    M include/qemu/mmap-alloc.h
    M migration/migration.c
    M migration/migration.h
    M migration/multifd.c
    M migration/postcopy-ram.c
    M migration/ram.c
    M migration/ram.h
    M migration/rdma.c
    M migration/savevm.c
    M softmmu/vl.c
    M util/mmap-alloc.c

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

Migration Pull request (take 2)

Remove the two atomic patches that broke mips32.

Please, apply.

# -----BEGIN PGP SIGNATURE-----
#
# iQIzBAABCAAdFiEEGJn/jt6/WMzuA0uC9IfvGFhy1yMFAmRGYTkACgkQ9IfvGFhy
# 1yMD5RAApL8bJTMpmkZ8afxG124/CID7fvg/WMp3vOTG/6923XZHfosUwqrCCvzN
# 8qfSfOl4P5Gtv1dOU+ZBcgoFS3tj00Ud2YhcZiSVUy5LZPJNJEfv4YzIErDTJq3I
# wcv/CgHvK1CKJ5DZ1g9hqnRvw9qYiodDEHS7UxvhGzckFExHps2oWt9nDuEZefKV
# XptOX7YDFYmWE87fp8+rQMYGZEN/6Cc7p4HmSt9I11CgLbeaqTpmKuwTv89PU9qV
# 7/X9kfoHNsKsVKw5WosEdRvEqhVQbvcCCxq+TGpeQz6d5U2mY7RVxQSNJxXNdD3P
# uz7uannx+UhESgzf5GnwOMIcxWD6UMAcDt349IAWFbq5d1QGaXJ9fVVHVJDV1Irl
# XHqxkugNMxRVZ8hQy5gSE6UTpeIjkIpSoZGnGS7E/iLMZHZBgv7s5VK21mYxn/QF
# F9g3Ewo2lF+kpQ/ZEnQ9mFyCYtqOHOAOLAUa7/6WdGnUMuqQ47Fh+jbb+KdEyCLg
# l7yXk2gXAb8SN6957Tlvo9okOB4NzhDPDXgvewAG/1yW4zL9hA+YCMvEvy90N8Be
# rRKO7H9YlsW4wKjA//i2YNAbtaZN5+zeAS39m0exYmXA54AMufjWq/a7Ya/ix5Jo
# 452LEz5hA4ckXXtP715pKQjqafxWXbHSS1qw9LBfMYr5TEEWC6c=
# =JTxg
# -----END PGP SIGNATURE-----
# gpg: Signature made Mon 24 Apr 2023 12:00:09 PM BST
# gpg:                using RSA key 1899FF8EDEBF58CCEE034B82F487EF185872D723
# gpg: Good signature from "Juan Quintela <quintela@redhat.com>" [undefined]
# gpg:                 aka "Juan Quintela <quintela@trasno.org>" [undefined]
# gpg: WARNING: This key is not certified with a trusted signature!
# gpg:          There is no indication that the signature belongs to the owner.
# Primary key fingerprint: 1899 FF8E DEBF 58CC EE03  4B82 F487 EF18 5872 D723

* tag 'migration-20230420-pull-request' of 
https://gitlab.com/juan.quintela/qemu:
  migration: Pass migrate_caps_check() the old and new caps
  migration: rename enabled_capabilities to capabilities
  migration/postcopy: Detect file system on dest host
  vl.c: Create late backends before migration object
  util/mmap-alloc: qemu_fd_getfs()
  migration: Handle block device inactivation failures better
  migration: Rename normal to normal_pages
  migration: Rename duplicate to zero_pages
  migration: Make postcopy_requests atomic
  migration: Make dirty_sync_count atomic
  migration: Make downtime_bytes atomic
  migration: Make precopy_bytes atomic
  migration: Make dirty_sync_missed_zero_copy atomic
  migration: Make multifd_bytes atomic
  migration: Update atomic stats out of the mutex
  migration: Merge ram_counters and ram_atomic_counters
  migration: remove extra whitespace character for code style

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


Compare: https://github.com/qemu/qemu/compare/327ec8d6c2a2...81072abf1575



reply via email to

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