[Qemu-devel] [PATCH v6 00/19] Multifd

Juan Quintela posted 19 patches 6 years, 8 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20170808162629.32493-1-quintela@redhat.com
Test FreeBSD passed
Test checkpatch failed
Test docker passed
Test s390x passed
There is a newer version of this series
hmp.c                          |  16 ++
include/glib-compat.h          |   2 +
include/io/channel.h           |  46 ++++
io/channel.c                   |  77 ++++++
migration/channel.c            |  18 +-
migration/exec.c               |   2 +-
migration/fd.c                 |   2 +-
migration/migration.c          | 143 ++++++++++-
migration/migration.h          |   8 +
migration/qemu-file-channel.c  |  29 +--
migration/ram.c                | 537 ++++++++++++++++++++++++++++++++++++++++-
migration/ram.h                |   8 +
migration/socket.c             |  48 +++-
migration/socket.h             |  10 +
qapi-schema.json               |  44 +++-
tests/io-channel-helpers.c     |  55 +++++
tests/io-channel-helpers.h     |   4 +
tests/test-io-channel-buffer.c |  55 ++++-
18 files changed, 1049 insertions(+), 55 deletions(-)
[Qemu-devel] [PATCH v6 00/19] Multifd
Posted by Juan Quintela 6 years, 8 months ago
Hi

Things NOT done yet:

- still uses error_abort/fail.  I need to redo all the error pages to
  be able to return with errors from other threads.
- still connects synchronusly.  I need to redo the other changes to fix this.
- have to change the tests as danp wanted, I still don't undertand them.

Done:
- Improve migration_ioc_porcess_incoming
- teach about G_SOURCE_REMOVE/CONTINUE
- Add test for migration_has_all_channels
- use DEFIN_PROP*
- change recv_state to use pointers to parameters
  make easier to receive channels out of order
- use g_strdup_printf()
- improve count of threads to know when we have to finish
- report channel id's on errors
- Use last_page parameter for multifd_send_page() sooner
- Improve commets for address
- use g_new0() instead of g_malloc()
- create MULTIFD_CONTINUE instead of using UINT16_MAX
- clear memory used by group of pages
  once there, pass everything to the global state variables instead of being
  local to the function.  This way it works if we cancel migration and start
  a new one
- Really wait to create the migration_thread until all channels are created
- split initial_bytes setup to make clearer following patches.
- createRAM_SAVE_FLAG_MULTIFD_SYNC macro, to make clear what we are doing
- move setting of need_flush to inside bitmap_sync
- Lots of other small changes & reorderings

Please, comment.


[v5]

- tests from qio functions (a.k.a. make danp happy)
- 1st message from one channel to the other contains:
   <uuid> multifd <channel number>
   This would allow us to create more channels as we want them.
   a.k.a. Making dave happy
- Waiting in reception for new channels using qio listeners
  Getting threads, qio and reference counters working at the same time
  was interesing.
  Another make danp happy.

- Lots and lots of small changes and fixes.  Notice that the last 70 patches
  that I merged or so what to make this series easier/smaller.

- NOT DONE: I haven't been woring on measuring performance
  differences, this was about getting the creation of the
  threads/channels right.

So, what I want:

- Are people happy with how I have (ab)used qio channels? (yes danp,
  that is you).
- My understanding is th

ToDo:

- Make paolo happy: He wanted to test using control information
  through each channel, not only pages.  This requires yet more
  cleanups to be able to have more than one QEMUFile/RAMState open at
  the same time.

- How I create multiple channels.  Things I know:
  * with current changes, it should work with fd/channels (the multifd bits),
    but we don;t have a way to pass multiple fd;s or exec files.
    Danp, any idea about how to create an UI for it?
  * My idea is that we would split current code to be:
    + channel creation at migration.c
    + rest of bits at ram.c
    + change format to:
      <uuid> main <rest of migration capabilities/paramentes> so we can check
      <uuid> postcopy <no clue what parameters are needed>
          Dave wanted a way to create a new fd for postcopy for some time
    + Adding new channels is easy

- Performance data/numbers: Yes, I wanted to get this out at once, I
  would continue with this.


Please, review.


[v4]
This is the 4th version of multifd. Changes:
- XBZRLE don't need to be checked for
- Documentation and defaults are consistent
- split socketArgs
- use iovec instead of creating something similar.
- We use now the exported size of target page (another HACK removal)
- created qio_chanel_{wirtev,readv}_all functions.  the _full() name
  was already taken.
  What they do is the same that the without _all() function, but if it
  returns due to blocking it redo the call.
- it is checkpatch.pl clean now.

Please comment, Juan.

Juan Quintela (19):
  migration: Create migration_ioc_process_incoming()
  migration: Teach it about G_SOURCE_REMOVE
  migration: Add comments to channel functions
  migration: Create migration_has_all_channels
  qio: Create new qio_channel_{readv,writev}_all
  migration: Add multifd capability
  migration: Create x-multifd-threads parameter
  migration: Create x-multifd-group parameter
  migration: Create multifd migration threads
  migration: Split migration_fd_process_incoming
  migration: Start of multiple fd work
  migration: Create ram_multifd_page
  migration: Really use multiple pages at a time
  migration: Send the fd number which we are going to use for this page
  migration: Create thread infrastructure for multifd recv side
  migration: Test new fd infrastructure
  migration: Rename initial_bytes
  migration: Transfer pages over new channels
  migration: Flush receive queue

 hmp.c                          |  16 ++
 include/glib-compat.h          |   2 +
 include/io/channel.h           |  46 ++++
 io/channel.c                   |  77 ++++++
 migration/channel.c            |  18 +-
 migration/exec.c               |   2 +-
 migration/fd.c                 |   2 +-
 migration/migration.c          | 143 ++++++++++-
 migration/migration.h          |   8 +
 migration/qemu-file-channel.c  |  29 +--
 migration/ram.c                | 537 ++++++++++++++++++++++++++++++++++++++++-
 migration/ram.h                |   8 +
 migration/socket.c             |  48 +++-
 migration/socket.h             |  10 +
 qapi-schema.json               |  44 +++-
 tests/io-channel-helpers.c     |  55 +++++
 tests/io-channel-helpers.h     |   4 +
 tests/test-io-channel-buffer.c |  55 ++++-
 18 files changed, 1049 insertions(+), 55 deletions(-)

-- 
2.9.4


Re: [Qemu-devel] [PATCH v6 00/19] Multifd
Posted by no-reply@patchew.org 6 years, 8 months ago
Hi,

This series seems to have some coding style problems. See output below for
more information:

Message-id: 20170808162629.32493-1-quintela@redhat.com
Subject: [Qemu-devel] [PATCH v6 00/19] Multifd
Type: series

=== TEST SCRIPT BEGIN ===
#!/bin/bash

BASE=base
n=1
total=$(git log --oneline $BASE.. | wc -l)
failed=0

git config --local diff.renamelimit 0
git config --local diff.renames True

commits="$(git log --format=%H --reverse $BASE..)"
for c in $commits; do
    echo "Checking PATCH $n/$total: $(git log -n 1 --format=%s $c)..."
    if ! git show $c --format=email | ./scripts/checkpatch.pl --mailback -; then
        failed=1
        echo
    fi
    n=$((n+1))
done

exit $failed
=== TEST SCRIPT END ===

Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
Switched to a new branch 'test'
00a9b5e8ae migration: Flush receive queue
e916ec0901 migration: Transfer pages over new channels
399ab56582 migration: Rename initial_bytes
f7873b901c migration: Test new fd infrastructure
881e5e18a6 migration: Create thread infrastructure for multifd recv side
6a65acd553 migration: Send the fd number which we are going to use for this page
da613ef42c migration: Really use multiple pages at a time
f4bedd6cc4 migration: Create ram_multifd_page
7eefb24552 migration: Start of multiple fd work
c1cfe5f5ca migration: Split migration_fd_process_incoming
8a3e50c51c migration: Create multifd migration threads
59cc6bad61 migration: Create x-multifd-group parameter
53f8404fa4 migration: Create x-multifd-threads parameter
acf538cb8e migration: Add multifd capability
4cbb7c4374 qio: Create new qio_channel_{readv, writev}_all
eec3514870 migration: Create migration_has_all_channels
0ccdee3bbc migration: Add comments to channel functions
e53ddce966 migration: Teach it about G_SOURCE_REMOVE
e64d5e3c8a migration: Create migration_ioc_process_incoming()

=== OUTPUT BEGIN ===
Checking PATCH 1/19: migration: Create migration_ioc_process_incoming()...
ERROR: trailing whitespace
#59: FILE: migration/migration.c:369:
+    $

total: 1 errors, 0 warnings, 72 lines checked

Your patch has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

Checking PATCH 2/19: migration: Teach it about G_SOURCE_REMOVE...
Checking PATCH 3/19: migration: Add comments to channel functions...
Checking PATCH 4/19: migration: Create migration_has_all_channels...
Checking PATCH 5/19: qio: Create new qio_channel_{readv, writev}_all...
Checking PATCH 6/19: migration: Add multifd capability...
Checking PATCH 7/19: migration: Create x-multifd-threads parameter...
Checking PATCH 8/19: migration: Create x-multifd-group parameter...
Checking PATCH 9/19: migration: Create multifd migration threads...
Checking PATCH 10/19: migration: Split migration_fd_process_incoming...
Checking PATCH 11/19: migration: Start of multiple fd work...
Checking PATCH 12/19: migration: Create ram_multifd_page...
Checking PATCH 13/19: migration: Really use multiple pages at a time...
Checking PATCH 14/19: migration: Send the fd number which we are going to use for this page...
Checking PATCH 15/19: migration: Create thread infrastructure for multifd recv side...
Checking PATCH 16/19: migration: Test new fd infrastructure...
Checking PATCH 17/19: migration: Rename initial_bytes...
Checking PATCH 18/19: migration: Transfer pages over new channels...
Checking PATCH 19/19: migration: Flush receive queue...
WARNING: line over 80 characters
#38: FILE: migration/ram.c:79:
+#define RAM_SAVE_FLAG_MULTIFD_SYNC (RAM_SAVE_FLAG_MULTIFD_PAGE | RAM_SAVE_FLAG_ZERO)

total: 0 errors, 1 warnings, 120 lines checked

Your patch has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
=== OUTPUT END ===

Test command exited with code: 1


---
Email generated automatically by Patchew [http://patchew.org/].
Please send your feedback to patchew-devel@freelists.org