qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Peter Xu <peterx@redhat.com>
To: Fabiano Rosas <farosas@suse.de>
Cc: qemu-devel@nongnu.org, berrange@redhat.com, armbru@redhat.com,
	Claudio Fontana <cfontana@suse.de>, Jim Fehlig <jfehlig@suse.com>
Subject: Re: [PATCH v3 12/16] migration/multifd: Add direct-io support
Date: Mon, 17 Jun 2024 15:19:50 -0400	[thread overview]
Message-ID: <ZnCMVl3F9m9Laazd@x1n> (raw)
In-Reply-To: <20240617185731.9725-13-farosas@suse.de>

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



  reply	other threads:[~2024-06-17 19:20 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-17 18:57 [PATCH v3 00/16] migration/mapped-ram: Add direct-io support Fabiano Rosas
2024-06-17 18:57 ` [PATCH v3 01/16] migration: Drop reference to QIOChannel if file seeking fails Fabiano Rosas
2024-06-17 19:17   ` Peter Xu
2024-06-17 18:57 ` [PATCH v3 02/16] migration: Fix file migration with fdset Fabiano Rosas
2024-06-22  4:21   ` Michael Tokarev
2024-06-23 15:44     ` Peter Xu
2024-06-17 18:57 ` [PATCH v3 03/16] tests/qtest/migration: Fix file migration offset check Fabiano Rosas
2024-06-17 18:57 ` [PATCH v3 04/16] tests/qtest/migration: Add a precopy file test with fdset Fabiano Rosas
2024-06-17 18:57 ` [PATCH v3 05/16] monitor: Drop monitor_fdset_dup_fd_find/_remove() Fabiano Rosas
2024-06-17 18:57 ` [PATCH v3 06/16] monitor: Introduce monitor_fdset_*free Fabiano Rosas
2024-06-17 18:57 ` [PATCH v3 07/16] monitor: Stop removing non-duplicated fds Fabiano Rosas
2024-06-17 18:57 ` [PATCH v3 08/16] monitor: Simplify fdset and fd removal Fabiano Rosas
2024-06-17 18:57 ` [PATCH v3 09/16] monitor: Report errors from monitor_fdset_dup_fd_add Fabiano Rosas
2024-06-17 18:57 ` [PATCH v3 10/16] io: Stop using qemu_open_old in channel-file Fabiano Rosas
2024-06-17 18:57 ` [PATCH v3 11/16] migration: Add direct-io parameter Fabiano Rosas
2024-06-17 18:57 ` [PATCH v3 12/16] migration/multifd: Add direct-io support Fabiano Rosas
2024-06-17 19:19   ` Peter Xu [this message]
2024-06-17 18:57 ` [PATCH v3 13/16] tests/qtest/migration: Add tests for file migration with direct-io Fabiano Rosas
2024-06-17 18:57 ` [PATCH v3 14/16] monitor: fdset: Match against O_DIRECT Fabiano Rosas
2024-06-17 18:57 ` [PATCH v3 15/16] migration: Add documentation for fdset with multifd + file Fabiano Rosas
2024-06-17 18:57 ` [PATCH v3 16/16] tests/qtest/migration: Add a test for mapped-ram with passing of fds Fabiano Rosas
2024-06-17 19:27   ` Peter Xu
2024-06-21 12:33     ` Fabiano Rosas
2024-06-21 14:16       ` Peter Xu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZnCMVl3F9m9Laazd@x1n \
    --to=peterx@redhat.com \
    --cc=armbru@redhat.com \
    --cc=berrange@redhat.com \
    --cc=cfontana@suse.de \
    --cc=farosas@suse.de \
    --cc=jfehlig@suse.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).