Hi everyone, here's the rest of the migration "mapped-ram" feature that didn't get merged for 9.0. This series adds support for direct I/O, the missing piece to get the desired performance improvements.
There's 3 parts to this: 1- The plumbing for the new "direct-io" migration parameter. With this we can already use direct-io with the file transport + multifd + mapped-ram. Patches 1-3. Due to the alignment requirements of O_DIRECT and the fact that multifd runs the channels in parallel with the migration thread, we must open the migration file two times, one with O_DIRECT set and another with it clear. If the user is not passing in a file name which QEMU can open at will, we must then require that the user pass the two file descriptors with the flags already properly set. We'll use the already existing fdset + QMP add-fd infrastructure for this. 2- Changes to the fdset infrastructure to support O_DIRECT. We need those to be able to select from the user-provided fdset the file descriptor that contains the O_DIRECT flag. Patches 4-5. 3- Some fdset validation to make sure the two-fds requirement is being met. Patches 6-7. CI run: https://gitlab.com/farosas/qemu/-/pipelines/1269352083 Fabiano Rosas (9): monitor: Honor QMP request for fd removal immediately migration: Fix file migration with fdset tests/qtest/migration: Fix file migration offset check migration: Add direct-io parameter migration/multifd: Add direct-io support tests/qtest/migration: Add tests for file migration with direct-io monitor: fdset: Match against O_DIRECT migration: Add support for fdset with multifd + file tests/qtest/migration: Add a test for mapped-ram with passing of fds docs/devel/migration/main.rst | 18 +++ docs/devel/migration/mapped-ram.rst | 6 +- include/qemu/osdep.h | 2 + migration/file.c | 108 ++++++++++++++- migration/migration-hmp-cmds.c | 11 ++ migration/migration.c | 23 ++++ migration/options.c | 30 +++++ migration/options.h | 1 + monitor/fds.c | 13 +- qapi/migration.json | 18 ++- tests/qtest/migration-helpers.c | 42 ++++++ tests/qtest/migration-helpers.h | 1 + tests/qtest/migration-test.c | 202 +++++++++++++++++++++++++++- util/osdep.c | 9 ++ 14 files changed, 465 insertions(+), 19 deletions(-) base-commit: a118c4aff4087eafb68f7132b233ad548cf16376 -- 2.35.3