[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v3 12/16] migration/multifd: Add direct-io support
From: |
Peter Xu |
Subject: |
Re: [PATCH v3 12/16] migration/multifd: Add direct-io support |
Date: |
Mon, 17 Jun 2024 15:19:50 -0400 |
On Mon, Jun 17, 2024 at 03:57:27PM -0300, Fabiano Rosas wrote:
> When multifd is used along with mapped-ram, we can take benefit of a
> filesystem that supports the O_DIRECT flag and perform direct I/O in
> the multifd threads. This brings a significant performance improvement
> because direct-io writes bypass the page cache which would otherwise
> be thrashed by the multifd data which is unlikely to be needed again
> in a short period of time.
>
> To be able to use a multifd channel opened with O_DIRECT, we must
> ensure that a certain aligment is used. Filesystems usually require a
> block-size alignment for direct I/O. The way to achieve this is by
> enabling the mapped-ram feature, which already aligns its I/O properly
> (see MAPPED_RAM_FILE_OFFSET_ALIGNMENT at ram.c).
>
> By setting O_DIRECT on the multifd channels, all writes to the same
> file descriptor need to be aligned as well, even the ones that come
> from outside multifd, such as the QEMUFile I/O from the main migration
> code. This makes it impossible to use the same file descriptor for the
> QEMUFile and for the multifd channels. The various flags and metadata
> written by the main migration code will always be unaligned by virtue
> of their small size. To workaround this issue, we'll require a second
> file descriptor to be used exclusively for direct I/O.
>
> The second file descriptor can be obtained by QEMU by re-opening the
> migration file (already possible), or by being provided by the user or
> management application (support to be added in future patches).
>
> Signed-off-by: Fabiano Rosas <farosas@suse.de>
Reviewed-by: Peter Xu <peterx@redhat.com>
--
Peter Xu
- [PATCH v3 03/16] tests/qtest/migration: Fix file migration offset check, (continued)
- [PATCH v3 03/16] tests/qtest/migration: Fix file migration offset check, Fabiano Rosas, 2024/06/17
- [PATCH v3 04/16] tests/qtest/migration: Add a precopy file test with fdset, Fabiano Rosas, 2024/06/17
- [PATCH v3 05/16] monitor: Drop monitor_fdset_dup_fd_find/_remove(), Fabiano Rosas, 2024/06/17
- [PATCH v3 06/16] monitor: Introduce monitor_fdset_*free, Fabiano Rosas, 2024/06/17
- [PATCH v3 07/16] monitor: Stop removing non-duplicated fds, Fabiano Rosas, 2024/06/17
- [PATCH v3 08/16] monitor: Simplify fdset and fd removal, Fabiano Rosas, 2024/06/17
- [PATCH v3 09/16] monitor: Report errors from monitor_fdset_dup_fd_add, Fabiano Rosas, 2024/06/17
- [PATCH v3 10/16] io: Stop using qemu_open_old in channel-file, Fabiano Rosas, 2024/06/17
- [PATCH v3 11/16] migration: Add direct-io parameter, Fabiano Rosas, 2024/06/17
- [PATCH v3 12/16] migration/multifd: Add direct-io support, Fabiano Rosas, 2024/06/17
- Re: [PATCH v3 12/16] migration/multifd: Add direct-io support,
Peter Xu <=
- [PATCH v3 13/16] tests/qtest/migration: Add tests for file migration with direct-io, Fabiano Rosas, 2024/06/17
- [PATCH v3 14/16] monitor: fdset: Match against O_DIRECT, Fabiano Rosas, 2024/06/17
- [PATCH v3 15/16] migration: Add documentation for fdset with multifd + file, Fabiano Rosas, 2024/06/17
- [PATCH v3 16/16] tests/qtest/migration: Add a test for mapped-ram with passing of fds, Fabiano Rosas, 2024/06/17