qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: Stefan Hajnoczi <stefanha@redhat.com>, qemu-devel@nongnu.org
Cc: Kevin Wolf <kwolf@redhat.com>, Max Reitz <mreitz@redhat.com>,
	qemu-block@nongnu.org, Daniel Berrange <berrange@redhat.com>,
	Markus Armbruster <armbru@redhat.com>,
	Neil Skrypuch <neil@tembosocial.com>,
	Stefano Garzarella <sgarzare@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v2] file-posix: add drop-cache=on|off option
Date: Fri, 1 Mar 2019 10:30:07 -0600	[thread overview]
Message-ID: <bd5824cb-7adb-1e96-fbd2-eb666288c253@redhat.com> (raw)
In-Reply-To: <20190301160929.19892-1-stefanha@redhat.com>

On 3/1/19 10:09 AM, Stefan Hajnoczi wrote:
> Commit dd577a26ff03b6829721b1ffbbf9e7c411b72378 ("block/file-posix:
> implement bdrv_co_invalidate_cache() on Linux") introduced page cache
> invalidation so that cache.direct=off live migration is safe on Linux.
> 
> The invalidation takes a significant amount of time when the file is
> large and present in the page cache.  Normally this is not the case for
> cross-host live migration but it can happen when migrating between QEMU
> processes on the same host.
> 
> On same-host migration we don't need to invalidate pages for correctness
> anyway, so an option to skip page cache invalidation is useful.  I
> investigated optimizing invalidation and detecting same-host migration,
> but both are hard to achieve so a user-visible option will suffice.
> 
> Suggested-by: Neil Skrypuch <neil@tembosocial.com>
> Tested-by: Neil Skrypuch <neil@tembosocial.com>
> Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
> Reviewed-by: Eric Blake <eblake@redhat.com>
> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
> ---
> v2:
>  * Remove outdated comment about libvirt feature detection [danpb]

Question - if we used qapi's 'if':COND to only declare the field on
platforms where we know at compile time that we can support it, would
that be enough for libvirt to introspect that if the field exists then
migration is safe, without having to rely on an query-qemu-features command?

> +++ b/qapi/block-core.json
> @@ -2807,6 +2807,10 @@
>  # @locking:     whether to enable file locking. If set to 'auto', only enable
>  #               when Open File Descriptor (OFD) locking API is available
>  #               (default: auto, since 2.10)
> +# @drop-cache:  invalidate page cache during live migration.  This prevents
> +#               stale data on the migration destination with cache.direct=off.
> +#               Currently only supported on Linux hosts.
> +#               (default: on, since: 4.0)
>  # @x-check-cache-dropped: whether to check that page cache was dropped on live
>  #                         migration.  May cause noticeable delays if the image
>  #                         file is large, do not use in production.
> @@ -2819,6 +2823,7 @@
>              '*pr-manager': 'str',
>              '*locking': 'OnOffAuto',
>              '*aio': 'BlockdevAioOptions',
> +            '*drop-cache': 'bool',
>              '*x-check-cache-dropped': 'bool' } }

In other words, now that we can use 'if' to hide features that aren't
supported based on compile-time knowledge, shouldn't we use that to make
the doc comment "only supported on Linux hosts" introspectible?

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org

  reply	other threads:[~2019-03-01 16:30 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-01 16:09 [Qemu-devel] [PATCH v2] file-posix: add drop-cache=on|off option Stefan Hajnoczi
2019-03-01 16:30 ` Eric Blake [this message]
2019-03-04  8:51   ` Markus Armbruster
2019-03-06 10:18   ` Stefan Hajnoczi
2019-03-06 12:44     ` Eric Blake
2019-03-06 12:50     ` Markus Armbruster

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=bd5824cb-7adb-1e96-fbd2-eb666288c253@redhat.com \
    --to=eblake@redhat.com \
    --cc=armbru@redhat.com \
    --cc=berrange@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=neil@tembosocial.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=sgarzare@redhat.com \
    --cc=stefanha@redhat.com \
    /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).