qemu-commits
[Top][All Lists]
Advanced

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

[Qemu-commits] [qemu/qemu] e4eee5: migration: All this fields are unsign


From: Peter Maydell
Subject: [Qemu-commits] [qemu/qemu] e4eee5: migration: All this fields are unsigned
Date: Thu, 27 Jan 2022 11:34:13 -0800

  Branch: refs/heads/staging
  Home:   https://github.com/qemu/qemu
  Commit: e4eee5f2a5eca13e16d4655555f18fe1a55ade29
      
https://github.com/qemu/qemu/commit/e4eee5f2a5eca13e16d4655555f18fe1a55ade29
  Author: Juan Quintela <quintela@redhat.com>
  Date:   2022-01-27 (Thu, 27 Jan 2022)

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

  Log Message:
  -----------
  migration: All this fields are unsigned

So printing it as %d is wrong.  Notice that for the channel id, that
is an uint8_t, but I changed it anyways for consistency.

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Peter Xu <peterx@redhat.com>


  Commit: dc081fa3065549e94f34974c9f88504120c81939
      
https://github.com/qemu/qemu/commit/dc081fa3065549e94f34974c9f88504120c81939
  Author: Juan Quintela <quintela@redhat.com>
  Date:   2022-01-27 (Thu, 27 Jan 2022)

  Changed paths:
    M migration/ram.c

  Log Message:
  -----------
  migration: We only need last_stage in two places

We only need last_stage in two places and we are passing it all
around.  Just add a field to RAMState that passes it.

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

---

Repeat subject (philmd suggestion)


  Commit: 46b033afca2192d4f261f993f6fe21682d4935a7
      
https://github.com/qemu/qemu/commit/46b033afca2192d4f261f993f6fe21682d4935a7
  Author: Juan Quintela <quintela@redhat.com>
  Date:   2022-01-27 (Thu, 27 Jan 2022)

  Changed paths:
    M migration/ram.c

  Log Message:
  -----------
  migration: ram_release_pages() always receive 1 page as argument

Remove the pages argument. And s/pages/page/

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Peter Xu <peterx@redhat.com>

---

- Use 1LL instead of casts (philmd)
- Change the whole 1ULL for TARGET_PAGE_SIZE


  Commit: 810952471d18597f0d74c027a70f4a94890ec8be
      
https://github.com/qemu/qemu/commit/810952471d18597f0d74c027a70f4a94890ec8be
  Author: Juan Quintela <quintela@redhat.com>
  Date:   2022-01-27 (Thu, 27 Jan 2022)

  Changed paths:
    M migration/ram.c

  Log Message:
  -----------
  migration: Remove masking for compression

Remove the mask in the call to ram_release_pages().  Nothing else does
it, and if the offset has that bits set, we have a lot of trouble.

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


  Commit: fdb38e59793c3326a63ad65d2fe419e07ffc5a59
      
https://github.com/qemu/qemu/commit/fdb38e59793c3326a63ad65d2fe419e07ffc5a59
  Author: Juan Quintela <quintela@redhat.com>
  Date:   2022-01-27 (Thu, 27 Jan 2022)

  Changed paths:
    M migration/ram.c

  Log Message:
  -----------
  migration: simplify do_compress_ram_page

The goto is not needed at all.

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


  Commit: 074b9dcf937077f40c76c076c5eec33ab638c59d
      
https://github.com/qemu/qemu/commit/074b9dcf937077f40c76c076c5eec33ab638c59d
  Author: Juan Quintela <quintela@redhat.com>
  Date:   2022-01-27 (Thu, 27 Jan 2022)

  Changed paths:
    M migration/ram.c

  Log Message:
  -----------
  migration: Move ram_release_pages() call to save_zero_page_to_file()

We always need to call it when we find a zero page, so put it in a
single place.

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


  Commit: b59367ce87e9e5515c774aa74f5fb706c11b8e03
      
https://github.com/qemu/qemu/commit/b59367ce87e9e5515c774aa74f5fb706c11b8e03
  Author: Juan Quintela <quintela@redhat.com>
  Date:   2022-01-27 (Thu, 27 Jan 2022)

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

  Log Message:
  -----------
  multifd: Use proper maximum compression values

It happens that there are functions to calculate the worst possible
compression size for a packet.  Use them.

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


  Commit: 24bdc972025720491bc7dd3e805190a5288bf5e3
      
https://github.com/qemu/qemu/commit/24bdc972025720491bc7dd3e805190a5288bf5e3
  Author: Juan Quintela <quintela@redhat.com>
  Date:   2022-01-27 (Thu, 27 Jan 2022)

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

  Log Message:
  -----------
  multifd: Move iov from pages to params

This will allow us to reduce the number of system calls on the next patch.

Signed-off-by: Juan Quintela <quintela@redhat.com>


  Commit: 3f4e3ea9c6fdfa89f7c9fadcb6d764ef920c45cb
      
https://github.com/qemu/qemu/commit/3f4e3ea9c6fdfa89f7c9fadcb6d764ef920c45cb
  Author: Juan Quintela <quintela@redhat.com>
  Date:   2022-01-27 (Thu, 27 Jan 2022)

  Changed paths:
    M migration/multifd-zlib.c

  Log Message:
  -----------
  multifd: Make zlib use iov's

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


  Commit: ee7568eb199b980ddec49bc7f819016bad129d78
      
https://github.com/qemu/qemu/commit/ee7568eb199b980ddec49bc7f819016bad129d78
  Author: Juan Quintela <quintela@redhat.com>
  Date:   2022-01-27 (Thu, 27 Jan 2022)

  Changed paths:
    M migration/multifd-zstd.c

  Log Message:
  -----------
  multifd: Make zstd use iov's

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


  Commit: 82d5a9a369bb4430282335aa2e1fe71d5106e939
      
https://github.com/qemu/qemu/commit/82d5a9a369bb4430282335aa2e1fe71d5106e939
  Author: Juan Quintela <quintela@redhat.com>
  Date:   2022-01-27 (Thu, 27 Jan 2022)

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

  Log Message:
  -----------
  multifd: Remove send_write() method

Everything use now iov's.

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


  Commit: 82d087f8a423732a1aa425bf89b6d374ce8f9cd3
      
https://github.com/qemu/qemu/commit/82d087f8a423732a1aa425bf89b6d374ce8f9cd3
  Author: Juan Quintela <quintela@redhat.com>
  Date:   2022-01-27 (Thu, 27 Jan 2022)

  Changed paths:
    M migration/multifd.c

  Log Message:
  -----------
  multifd: Use a single writev on the send side

Until now, we wrote the packet header with write(), and the rest of the
pages with writev().  Just increase the size of the iovec and do a
single writev().

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


  Commit: 76880e9e019dad0ce233bcf945a344068e51da41
      
https://github.com/qemu/qemu/commit/76880e9e019dad0ce233bcf945a344068e51da41
  Author: Juan Quintela <quintela@redhat.com>
  Date:   2022-01-27 (Thu, 27 Jan 2022)

  Changed paths:
    M migration/multifd.c

  Log Message:
  -----------
  multifd: Unfold "used" variable by its value

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


  Commit: 7889d455a9c52f0a5bc3137bd4573b177bea7440
      
https://github.com/qemu/qemu/commit/7889d455a9c52f0a5bc3137bd4573b177bea7440
  Author: Juan Quintela <quintela@redhat.com>
  Date:   2022-01-27 (Thu, 27 Jan 2022)

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

  Log Message:
  -----------
  multifd: Use normal pages array on the send side

We are only sending normal pages through multifd channels.
Later on this series, we are going to also send zero pages.
We are going to detect if a page is zero or non zero in the multifd
channel thread, not on the main thread.

So we receive an array of pages page->offset[N]

And we will end with:

p->normal[N - zero_pages]
p->zero[zero_pages].

In this patch, we just copy all the pages in offset to normal.

for (i = 0; i < pages->num; i++) {
    p->narmal[p->normal_num] = pages->offset[i];
    p->normal_num++:
}

Later in the series this becomes:

for (i = 0; i < pages->num; i++) {
    if (buffer_is_zero(page->offset[i])) {
        p->zerol[p->zero_num] = pages->offset[i];
        p->zero_num++:
    } else {
        p->narmal[p->normal_num] = pages->offset[i];
        p->normal_num++:
    }
}

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

---

Improving comment (dave)
Renaming num_normal_pages to total_normal_pages (peter)


  Commit: a4009988e65499902fbd5f7c2a9546a32670bfa9
      
https://github.com/qemu/qemu/commit/a4009988e65499902fbd5f7c2a9546a32670bfa9
  Author: Juan Quintela <quintela@redhat.com>
  Date:   2022-01-27 (Thu, 27 Jan 2022)

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

  Log Message:
  -----------
  multifd: Use normal pages array on the recv side

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

---

Rename num_normal_pages to total_normal_pages (peter)


  Commit: ceed621ce97f988b21284697da3459a4b8a7d56d
      
https://github.com/qemu/qemu/commit/ceed621ce97f988b21284697da3459a4b8a7d56d
  Author: Juan Quintela <quintela@redhat.com>
  Date:   2022-01-27 (Thu, 27 Jan 2022)

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

  Log Message:
  -----------
  multifd: recv side only needs the RAMBlock host address

So we can remove the MultiFDPages.

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


  Commit: fbbcd7ffa13b254c5bf9966661458eb64e6d148d
      
https://github.com/qemu/qemu/commit/fbbcd7ffa13b254c5bf9966661458eb64e6d148d
  Author: Juan Quintela <quintela@redhat.com>
  Date:   2022-01-27 (Thu, 27 Jan 2022)

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

  Log Message:
  -----------
  multifd: Rename pages_used to normal_pages

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


  Commit: 041af25cafc8defeb593d38f06d3f52d4f2a3307
      
https://github.com/qemu/qemu/commit/041af25cafc8defeb593d38f06d3f52d4f2a3307
  Author: Peter Maydell <peter.maydell@linaro.org>
  Date:   2022-01-27 (Thu, 27 Jan 2022)

  Changed paths:
    M hw/acpi/cpu.c
    M hw/acpi/ich9.c
    M hw/acpi/memory_hotplug.c
    M hw/acpi/piix4.c
    M hw/acpi/tco.c
    M hw/audio/pcspk.c
    M hw/display/macfb.c
    M hw/dma/xlnx-zdma.c
    M hw/dma/xlnx_csu_dma.c
    M hw/gpio/imx_gpio.c
    M hw/misc/bcm2835_mbox.c
    M hw/net/can/can_kvaser_pci.c
    M hw/net/can/can_mioe3680_pci.c
    M hw/net/can/can_pcm3680_pci.c
    M hw/net/can/can_sja1000.c
    M hw/net/can/ctucan_core.c
    M hw/net/can/ctucan_pci.c
    M hw/ppc/ppc.c
    M hw/scsi/megasas.c
    M hw/scsi/mptsas.c
    M hw/virtio/virtio-mmio.c
    M hw/virtio/virtio-pci.c
    M hw/virtio/virtio.c
    M target/openrisc/machine.c
    M target/ppc/machine.c
    M target/sparc/machine.c

  Log Message:
  -----------
  Remove unnecessary minimum_version_id_old fields

The migration code will not look at a VMStateDescription's
minimum_version_id_old field unless that VMSD has set the
load_state_old field to something non-NULL.  (The purpose of
minimum_version_id_old is to specify what migration version is needed
for the code in the function pointed to by load_state_old to be able
to handle it on incoming migration.)

We have exactly one VMSD which still has a load_state_old,
in the PPC CPU; every other VMSD which sets minimum_version_id_old
is doing so unnecessarily. Delete all the unnecessary ones.

Commit created with:
  sed -i '/\.minimum_version_id_old/d' $(git grep -l '\.minimum_version_id_old')
with the one legitimate use then hand-edited back in.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Juan Quintela <quintela@redhat.com>

Signed-off-by: Juan Quintela <quintela@redhat.com>

---

It missed vmstate_ppc_cpu.


  Commit: 2ce812e3271ab13db06fdeef106a8ce7b3e36d51
      
https://github.com/qemu/qemu/commit/2ce812e3271ab13db06fdeef106a8ce7b3e36d51
  Author: Zhang Chen <chen.zhang@intel.com>
  Date:   2022-01-27 (Thu, 27 Jan 2022)

  Changed paths:
    M migration/migration.c

  Log Message:
  -----------
  migration/migration.c: Add missed default error handler for migration state

In the migration_completion() no other status is expected, for
example MIGRATION_STATUS_CANCELLING, MIGRATION_STATUS_CANCELLED, etc.

Signed-off-by: Zhang Chen <chen.zhang@intel.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: 79b37d49a5d5d281256ff3e3d0e1d7dc4b0eb6bf
      
https://github.com/qemu/qemu/commit/79b37d49a5d5d281256ff3e3d0e1d7dc4b0eb6bf
  Author: Zhang Chen <chen.zhang@intel.com>
  Date:   2022-01-27 (Thu, 27 Jan 2022)

  Changed paths:
    M migration/migration.c

  Log Message:
  -----------
  migration/migration.c: Avoid COLO boot in postcopy migration

COLO dose not support postcopy migration and remove the Fixme.

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: 8a2364dd3a9251039592485659defd44ca2060ad
      
https://github.com/qemu/qemu/commit/8a2364dd3a9251039592485659defd44ca2060ad
  Author: Zhang Chen <chen.zhang@intel.com>
  Date:   2022-01-27 (Thu, 27 Jan 2022)

  Changed paths:
    M migration/migration.c

  Log Message:
  -----------
  migration/migration.c: Remove the MIGRATION_STATUS_ACTIVE when migration 
finished

The MIGRATION_STATUS_ACTIVE indicates that migration is running.
Remove it to be handled by the default operation,
It should be part of the unknown ending states.

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: 6a6b00bdb8dfc57eba322c480195f0ecf1ea62d7
      
https://github.com/qemu/qemu/commit/6a6b00bdb8dfc57eba322c480195f0ecf1ea62d7
  Author: David Edmondson <david.edmondson@oracle.com>
  Date:   2022-01-27 (Thu, 27 Jan 2022)

  Changed paths:
    M migration/savevm.c

  Log Message:
  -----------
  migration: Report the error returned when save_live_iterate fails

Should qemu_savevm_state_iterate() encounter a failure when calling a
particular save_live_iterate function, report the error code returned
by the function.

Signed-off-by: David Edmondson <david.edmondson@oracle.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: 0b71f2da38500f8f15787df30a3ac44e4c04f88f
      
https://github.com/qemu/qemu/commit/0b71f2da38500f8f15787df30a3ac44e4c04f88f
  Author: Dr. David Alan Gilbert <dgilbert@redhat.com>
  Date:   2022-01-27 (Thu, 27 Jan 2022)

  Changed paths:
    M include/migration/vmstate.h
    M migration/savevm.c
    M migration/vmstate.c

  Log Message:
  -----------
  migration: Add canary to VMSTATE_END_OF_LIST

We fairly regularly forget VMSTATE_END_OF_LIST markers off descriptions;
given that the current check is only for ->name being NULL, sometimes
we get unlucky and the code apparently works and no one spots the error.

Explicitly add a flag, VMS_END that should be set, and assert it is
set during the traversal.

Note: This can't go in until we update the copy of vmstate.h in slirp.

Suggested-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>


  Commit: 6ae83463b2354e395a65463b0059a500c1bb6299
      
https://github.com/qemu/qemu/commit/6ae83463b2354e395a65463b0059a500c1bb6299
  Author: Dr. David Alan Gilbert <dgilbert@redhat.com>
  Date:   2022-01-27 (Thu, 27 Jan 2022)

  Changed paths:
    M migration/savevm.c

  Log Message:
  -----------
  migration: Perform vmsd structure check during tests

Perform a check on vmsd structures during test runs in the hope
of catching any missing terminators and other simple screwups.

Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>


  Commit: 1e18b5d2e6812aff276e132e908e23ba9d951b1b
      
https://github.com/qemu/qemu/commit/1e18b5d2e6812aff276e132e908e23ba9d951b1b
  Author: Xu Zheng <xuzheng@cmss.chinamobile.com>
  Date:   2022-01-27 (Thu, 27 Jan 2022)

  Changed paths:
    M migration/ram.c

  Log Message:
  -----------
  migration/ram: clean up unused comment.

Just a removal of an unused comment.
a0a8aa147aa did many fixes and removed the parameter named "ms", but forget to 
remove the corresponding comment in function named "ram_save_host_page".

Signed-off-by: Xu Zheng <xuzheng@cmss.chinamobile.com>
Signed-off-by: Mao Zhongyi <maozhongyi@cmss.chinamobile.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>


  Commit: 0b1f18657564e6d4b200c48327a71193cacd7a28
      
https://github.com/qemu/qemu/commit/0b1f18657564e6d4b200c48327a71193cacd7a28
  Author: Peter Xu <peterx@redhat.com>
  Date:   2022-01-27 (Thu, 27 Jan 2022)

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

  Log Message:
  -----------
  migration: Drop dead code of ram_debug_dump_bitmap()

I planned to add "#ifdef DEBUG_POSTCOPY" around the function too because
otherwise it'll be compiled into qemu binary even if it'll never be used.  Then
I found that maybe it's easier to just drop it for good..

Signed-off-by: Peter Xu <peterx@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@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: 88e7cdecf09e6646d674b2168121f6dfe738c5e3
      
https://github.com/qemu/qemu/commit/88e7cdecf09e6646d674b2168121f6dfe738c5e3
  Author: Peter Xu <peterx@redhat.com>
  Date:   2022-01-27 (Thu, 27 Jan 2022)

  Changed paths:
    M migration/ram.c

  Log Message:
  -----------
  migration: Don't return for postcopy_chunk_hostpages()

It always return zero, because it just can't go wrong so far.  Simplify the
code with no functional change.

Signed-off-by: Peter Xu <peterx@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@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: 674685ca676bf5a2c0e3683c63d10462a5274c4f
      
https://github.com/qemu/qemu/commit/674685ca676bf5a2c0e3683c63d10462a5274c4f
  Author: Peter Xu <peterx@redhat.com>
  Date:   2022-01-27 (Thu, 27 Jan 2022)

  Changed paths:
    M migration/ram.c

  Log Message:
  -----------
  migration: Drop postcopy_chunk_hostpages()

This function calls three functions:

  - postcopy_discard_send_init(ms, block->idstr);
  - postcopy_chunk_hostpages_pass(ms, block);
  - postcopy_discard_send_finish(ms);

However only the 2nd function call is meaningful.  It's major role is to make
sure dirty bits are applied in host-page-size granule, so there will be no
partial dirty bits set for a whole host page if huge pages are used.

The 1st/3rd call are for latter when we want to send the disgard ranges.
They're mostly no-op here besides some tracepoints (which are misleading!).

Drop them, then we can directly drop postcopy_chunk_hostpages() as a whole
because we can call postcopy_chunk_hostpages_pass() directly.

There're still some nice comments above postcopy_chunk_hostpages() that explain
what it does.  Copy it over to the caller's site.

Signed-off-by: Peter Xu <peterx@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: a627284577a1866bdcd4a9b9f34250a23a5ee1a6
      
https://github.com/qemu/qemu/commit/a627284577a1866bdcd4a9b9f34250a23a5ee1a6
  Author: Peter Xu <peterx@redhat.com>
  Date:   2022-01-27 (Thu, 27 Jan 2022)

  Changed paths:
    M migration/ram.c

  Log Message:
  -----------
  migration: Do chunk page in postcopy_each_ram_send_discard()

Right now we loop ramblocks for twice, the 1st time chunk the dirty bits with
huge page information; the 2nd time we send the discard ranges.  That's not
necessary - we can do them in a single loop.

Signed-off-by: Peter Xu <peterx@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: 8536d50813751b7f0af449251436b3b618b014d5
      
https://github.com/qemu/qemu/commit/8536d50813751b7f0af449251436b3b618b014d5
  Author: Peter Xu <peterx@redhat.com>
  Date:   2022-01-27 (Thu, 27 Jan 2022)

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

  Log Message:
  -----------
  migration: Drop return code for disgard ram process

It will just never fail.  Drop those return values where they're constantly
zeros.

A tiny touch-up on the tracepoint so trace_ram_postcopy_send_discard_bitmap()
is called after the logic itself (which sounds more reasonable).

Signed-off-by: Peter Xu <peterx@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@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: f7a5cf20cf309d35fb319d2549367d18d7b9387d
      
https://github.com/qemu/qemu/commit/f7a5cf20cf309d35fb319d2549367d18d7b9387d
  Author: Philippe Mathieu-Daudé <philmd@redhat.com>
  Date:   2022-01-27 (Thu, 27 Jan 2022)

  Changed paths:
    M migration/ram.c

  Log Message:
  -----------
  migration: Don't return for postcopy_send_discard_bm_ram()

postcopy_send_discard_bm_ram() always return zero. Since it can't
fail, simplify and do not return anything.

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: David Edmondson <david.edmondson@oracle.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>


  Commit: 89a2e449f0454daf1d8f8e3530f7e9b81ee4de08
      
https://github.com/qemu/qemu/commit/89a2e449f0454daf1d8f8e3530f7e9b81ee4de08
  Author: David Edmondson <david.edmondson@oracle.com>
  Date:   2022-01-27 (Thu, 27 Jan 2022)

  Changed paths:
    M migration/ram.c

  Log Message:
  -----------
  migration: Introduce ram_transferred_add()

Replace direct manipulation of ram_counters.transferred with a
function.

Signed-off-by: David Edmondson <david.edmondson@oracle.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>


  Commit: ecebb1e6fa64c08b03aafe136c6314dad12fc43d
      
https://github.com/qemu/qemu/commit/ecebb1e6fa64c08b03aafe136c6314dad12fc43d
  Author: David Edmondson <david.edmondson@oracle.com>
  Date:   2022-01-27 (Thu, 27 Jan 2022)

  Changed paths:
    M migration/migration.c
    M migration/ram.c
    M monitor/hmp-cmds.c
    M qapi/migration.json

  Log Message:
  -----------
  migration: Tally pre-copy, downtime and post-copy bytes independently

Provide information on the number of bytes copied in the pre-copy,
downtime and post-copy phases of migration.

Signed-off-by: David Edmondson <david.edmondson@oracle.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>


  Commit: 6e476657c19953b84607c962771f4f0e0a08b550
      
https://github.com/qemu/qemu/commit/6e476657c19953b84607c962771f4f0e0a08b550
  Author: Peter Xu <peterx@redhat.com>
  Date:   2022-01-27 (Thu, 27 Jan 2022)

  Changed paths:
    M migration/ram.c

  Log Message:
  -----------
  migration: No off-by-one for pss->page update in host page size

We used to do off-by-one fixup for pss->page when finished one host huge page
transfer.  That seems to be unnecesary at all.  Drop it.

Cc: Keqian Zhu <zhukeqian1@huawei.com>
Cc: Kunkun Jiang <jiangkunkun@huawei.com>
Cc: Andrey Gruzdev <andrey.gruzdev@virtuozzo.com>
Signed-off-by: Peter Xu <peterx@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: d254dbe88edc35ba675debaba7ed42f944f12e56
      
https://github.com/qemu/qemu/commit/d254dbe88edc35ba675debaba7ed42f944f12e56
  Author: Peter Xu <peterx@redhat.com>
  Date:   2022-01-27 (Thu, 27 Jan 2022)

  Changed paths:
    M migration/postcopy-ram.c

  Log Message:
  -----------
  migration: Enable UFFD_FEATURE_THREAD_ID even without blocktime feat

This patch allows us to read the tid even without blocktime feature enabled.
It's useful when tracing postcopy fault thread on faulted pages to show thread
id too with the address.

Remove the comments - they're merely not helpful at all.

Signed-off-by: Peter Xu <peterx@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: 5d8dcc48efacaa3bf20479ce68468d4a094311fc
      
https://github.com/qemu/qemu/commit/5d8dcc48efacaa3bf20479ce68468d4a094311fc
  Author: Peter Xu <peterx@redhat.com>
  Date:   2022-01-27 (Thu, 27 Jan 2022)

  Changed paths:
    M migration/ram.c

  Log Message:
  -----------
  migration: Add postcopy_has_request()

Add a helper to detect whether postcopy has pending request.

Since at it, cleanup the code a bit, e.g. in unqueue_page() we shouldn't need
to check it again on queue empty because we're the only one (besides cleanup
code, which should never run during this process) that will take a request off
the list, so the request list can only grow but not shrink under the hood.

Signed-off-by: Peter Xu <peterx@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: 3a3fd51decf5075f6c7af106665ada53d50381ac
      
https://github.com/qemu/qemu/commit/3a3fd51decf5075f6c7af106665ada53d50381ac
  Author: Peter Xu <peterx@redhat.com>
  Date:   2022-01-27 (Thu, 27 Jan 2022)

  Changed paths:
    M migration/ram.c
    M migration/trace-events

  Log Message:
  -----------
  migration: Simplify unqueue_page()

This patch simplifies unqueue_page() on both sides of it (itself, and caller).

Firstly, due to the fact that right after unqueue_page() returned true, we'll
definitely send a huge page (see ram_save_huge_page() call - it will _never_
exit before finish sending that huge page), so unqueue_page() does not need to
jump in small page size if huge page is enabled on the ramblock.  IOW, it's
destined that only the 1st 4K page will be valid, when unqueue the 2nd+ time
we'll notice the whole huge page has already been sent anyway.  Switching to
operating on huge page reduces a lot of the loops of redundant unqueue_page().

Meanwhile, drop the dirty check.  It's not helpful to call test_bit() every
time to jump over clean pages, as ram_save_host_page() has already done so,
while in a faster way (see commit ba1b7c812c ("migration/ram: Optimize
ram_save_host_page()", 2021-05-13)).  So that's not necessary too.

Drop the two tracepoints along the way - based on above analysis it's very
possible that no one is really using it..

Signed-off-by: Peter Xu <peterx@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: 4e29a822de430e8d0d8bf5c61aaff0561a713d84
      
https://github.com/qemu/qemu/commit/4e29a822de430e8d0d8bf5c61aaff0561a713d84
  Author: Peter Xu <peterx@redhat.com>
  Date:   2022-01-27 (Thu, 27 Jan 2022)

  Changed paths:
    M migration/postcopy-ram.c

  Log Message:
  -----------
  migration: Move temp page setup and cleanup into separate functions

Temp pages will need to grow if we want to have multiple channels for postcopy,
because each channel will need its own temp page to cache huge page data.

Before doing that, cleanup the related code.  No functional change intended.

Since at it, touch up the errno handling a little bit on the setup side.

Signed-off-by: Peter Xu <peterx@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: 948b01289b25e0b870840d1ffde3ca2ed034c9d7
      
https://github.com/qemu/qemu/commit/948b01289b25e0b870840d1ffde3ca2ed034c9d7
  Author: Peter Maydell <peter.maydell@linaro.org>
  Date:   2022-01-27 (Thu, 27 Jan 2022)

  Changed paths:
    M hw/acpi/cpu.c
    M hw/acpi/ich9.c
    M hw/acpi/memory_hotplug.c
    M hw/acpi/piix4.c
    M hw/acpi/tco.c
    M hw/audio/pcspk.c
    M hw/display/macfb.c
    M hw/dma/xlnx-zdma.c
    M hw/dma/xlnx_csu_dma.c
    M hw/gpio/imx_gpio.c
    M hw/misc/bcm2835_mbox.c
    M hw/net/can/can_kvaser_pci.c
    M hw/net/can/can_mioe3680_pci.c
    M hw/net/can/can_pcm3680_pci.c
    M hw/net/can/can_sja1000.c
    M hw/net/can/ctucan_core.c
    M hw/net/can/ctucan_pci.c
    M hw/ppc/ppc.c
    M hw/scsi/megasas.c
    M hw/scsi/mptsas.c
    M hw/virtio/virtio-mmio.c
    M hw/virtio/virtio-pci.c
    M hw/virtio/virtio.c
    M include/migration/vmstate.h
    M migration/migration.c
    M migration/multifd-zlib.c
    M migration/multifd-zstd.c
    M migration/multifd.c
    M migration/multifd.h
    M migration/postcopy-ram.c
    M migration/ram.c
    M migration/ram.h
    M migration/savevm.c
    M migration/trace-events
    M migration/vmstate.c
    M monitor/hmp-cmds.c
    M qapi/migration.json
    M target/openrisc/machine.c
    M target/ppc/machine.c
    M target/sparc/machine.c

  Log Message:
  -----------
  Merge remote-tracking branch 
'remotes/quintela-gitlab/tags/migration-20220127-pull-request' into staging

Migration Pull request

Hi

This pull request includes every patch ack'd on the list for migration.  In no 
particular order:

- ram_transferred_add() - (Edmondson)
- vmstate canary (dgilbert)
- minimum_version_id_old removal (peter maydell)
- postcopy cleanups (peter xu)
- more cleanups (Philippe)
- yet more cleanups (zheng)
- colo and cleanups (zhang)

Please, Apply.

# gpg: Signature made Thu 27 Jan 2022 14:04:31 GMT
# gpg:                using RSA key 1899FF8EDEBF58CCEE034B82F487EF185872D723
# gpg: Good signature from "Juan Quintela <quintela@redhat.com>" [full]
# gpg:                 aka "Juan Quintela <quintela@trasno.org>" [full]
# Primary key fingerprint: 1899 FF8E DEBF 58CC EE03  4B82 F487 EF18 5872 D723

* remotes/quintela-gitlab/tags/migration-20220127-pull-request: (38 commits)
  migration: Move temp page setup and cleanup into separate functions
  migration: Simplify unqueue_page()
  migration: Add postcopy_has_request()
  migration: Enable UFFD_FEATURE_THREAD_ID even without blocktime feat
  migration: No off-by-one for pss->page update in host page size
  migration: Tally pre-copy, downtime and post-copy bytes independently
  migration: Introduce ram_transferred_add()
  migration: Don't return for postcopy_send_discard_bm_ram()
  migration: Drop return code for disgard ram process
  migration: Do chunk page in postcopy_each_ram_send_discard()
  migration: Drop postcopy_chunk_hostpages()
  migration: Don't return for postcopy_chunk_hostpages()
  migration: Drop dead code of ram_debug_dump_bitmap()
  migration/ram: clean up unused comment.
  migration: Perform vmsd structure check during tests
  migration: Add canary to VMSTATE_END_OF_LIST
  migration: Report the error returned when save_live_iterate fails
  migration/migration.c: Remove the MIGRATION_STATUS_ACTIVE when migration 
finished
  migration/migration.c: Avoid COLO boot in postcopy migration
  migration/migration.c: Add missed default error handler for migration state
  ...

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>


Compare: https://github.com/qemu/qemu/compare/cfe63e46be0a...948b01289b25



reply via email to

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