All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: Fabiano Rosas <farosas@suse.de>
Cc: qemu-devel@nongnu.org,  berrange@redhat.com,
	 Juan Quintela <quintela@redhat.com>,
	 Peter Xu <peterx@redhat.com>,
	 Leonardo Bras <leobras@redhat.com>,
	 Claudio Fontana <cfontana@suse.de>,
	 Eric Blake <eblake@redhat.com>
Subject: Re: [PATCH v2 14/29] migration/ram: Introduce 'fixed-ram' migration capability
Date: Wed, 25 Oct 2023 08:18:58 +0200	[thread overview]
Message-ID: <87sf5zkywd.fsf@pond.sub.org> (raw)
In-Reply-To: <87zg07dg1u.fsf@suse.de> (Fabiano Rosas's message of "Tue, 24 Oct 2023 15:35:41 -0300")

Fabiano Rosas <farosas@suse.de> writes:

> Markus Armbruster <armbru@redhat.com> writes:
>
>> Fabiano Rosas <farosas@suse.de> writes:
>>
>>> Add a new migration capability 'fixed-ram'.
>>>
>>> The core of the feature is to ensure that each ram page has a specific
>>> offset in the resulting migration stream. The reason why we'd want
>>> such behavior are two fold:
>>>
>>>  - When doing a 'fixed-ram' migration the resulting file will have a
>>>    bounded size, since pages which are dirtied multiple times will
>>>    always go to a fixed location in the file, rather than constantly
>>>    being added to a sequential stream. This eliminates cases where a vm
>>>    with, say, 1G of ram can result in a migration file that's 10s of
>>>    GBs, provided that the workload constantly redirties memory.
>>>
>>>  - It paves the way to implement DIRECT_IO-enabled save/restore of the
>>>    migration stream as the pages are ensured to be written at aligned
>>>    offsets.
>>>
>>> For now, enabling the capability has no effect. The next couple of
>>> patches implement the core funcionality.
>>>
>>> Signed-off-by: Fabiano Rosas <farosas@suse.de>
>>> ---
>>>  docs/devel/migration.rst | 14 ++++++++++++++
>>>  migration/options.c      | 37 +++++++++++++++++++++++++++++++++++++
>>>  migration/options.h      |  1 +
>>>  migration/savevm.c       |  1 +
>>>  qapi/migration.json      |  5 ++++-
>>>  5 files changed, 57 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/docs/devel/migration.rst b/docs/devel/migration.rst
>>> index c3e1400c0c..6f898b5dbd 100644
>>> --- a/docs/devel/migration.rst
>>> +++ b/docs/devel/migration.rst
>>> @@ -566,6 +566,20 @@ Others (especially either older devices or system devices which for
>>>  some reason don't have a bus concept) make use of the ``instance id``
>>>  for otherwise identically named devices.
>>>  
>>> +Fixed-ram format
>>> +----------------
>>> +
>>> +When the ``fixed-ram`` capability is enabled, a slightly different
>>> +stream format is used for the RAM section. Instead of having a
>>> +sequential stream of pages that follow the RAMBlock headers, the dirty
>>> +pages for a RAMBlock follow its header. This ensures that each RAM
>>> +page has a fixed offset in the resulting migration stream.
>>
>> This requires the migration stream to be seekable, as documented in the
>> QAPI schema below.  I think it's worth documenting here, as well.
>>
>
> Ok.
>
>>> +
>>> +The ``fixed-ram`` capaility can be enabled in both source and
>>> +destination with:
>>> +
>>> +    ``migrate_set_capability fixed-ram on``
>>
>> Effect of enabling on the destination?
>>
>> What happens when we enable it only on one end?
>>
>
> qemu-system-x86_64: Capability fixed-ram is off, but received capability is on
> qemu-system-x86_64: load of migration failed: Invalid argument
>
> So I guess that *can* be enabled up there should become a *must*.

Makes sense.

>>> +
>>>  Return path
>>>  -----------
>>>  
>>
>> [...]
>>
>>> diff --git a/qapi/migration.json b/qapi/migration.json
>>> index 74f12adc0e..1317dd32ab 100644
>>> --- a/qapi/migration.json
>>> +++ b/qapi/migration.json
>>> @@ -527,6 +527,9 @@
>>>  #     VM before migration for an optimal migration performance.
>>>  #     Enabled by default. (since 8.1)
>>>  #
>>> +# @fixed-ram: Migrate using fixed offsets for each RAM page. Requires
>>
>> Two spaces between sentences for consistency, please.
>>
>>> +#             a seekable transport such as a file.  (since 8.1)
>>
>> What is a migration transport?  migration.json doesn't define the term.
>>
>
> The medium that transports the migration. We are about to define some
> terms at the QAPI series:
>
> [PATCH v15 00/14] migration: Modify 'migrate' and 'migrate-incoming'
> QAPI commands for migration
> https://lore.kernel.org/r/20231023182053.8711-1-farosas@suse.de

Can't find it there offhand.  No need to explain it further to me now,
just make sure it's defined at this point in the series when you respin.

>> Which transports are seekable?
>>
>
> The ones that implement QIO_CHANNEL_FEATURE_SEEKABLE. Currently only
> QIOChannelFile.

Transport seekability needs to be documented clearly.

>> Out of curiosity: what happens if the transport isn't seekable?
>
> We fail the migration. At migration_channels_and_uri_compatible():
>
>     if (migration_needs_seekable_channel() &&
>         !uri_supports_seeking(uri)) {
>         error_setg(errp, "Migration requires seekable transport (e.g. file)");
>         compatible = false;
>     }

Thanks!

>>> +#
>>>  # Features:
>>>  #
>>>  # @unstable: Members @x-colo and @x-ignore-shared are experimental.
>>> @@ -543,7 +546,7 @@
>>>             { 'name': 'x-ignore-shared', 'features': [ 'unstable' ] },
>>>             'validate-uuid', 'background-snapshot',
>>>             'zero-copy-send', 'postcopy-preempt', 'switchover-ack',
>>> -           'dirty-limit', 'auto-pause'] }
>>> +           'dirty-limit', 'auto-pause', 'fixed-ram'] }
>>>  
>>>  ##
>>>  # @MigrationCapabilityStatus:



  reply	other threads:[~2023-10-25  6:20 UTC|newest]

Thread overview: 128+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-23 20:35 [PATCH v2 00/29] migration: File based migration with multifd and fixed-ram Fabiano Rosas
2023-10-23 20:35 ` [PATCH v2 01/29] tests/qtest: migration events Fabiano Rosas
2023-10-25  9:44   ` Thomas Huth
2023-10-25 10:14   ` Daniel P. Berrangé
2023-10-25 13:21   ` Fabiano Rosas
2023-10-25 13:33     ` Steven Sistare
2023-10-23 20:35 ` [PATCH v2 02/29] tests/qtest: Move QTestMigrationState to libqtest Fabiano Rosas
2023-10-25 10:17   ` Daniel P. Berrangé
2023-10-25 13:19     ` Fabiano Rosas
2023-10-23 20:35 ` [PATCH v2 03/29] tests/qtest: Allow waiting for migration events Fabiano Rosas
2023-10-23 20:35 ` [PATCH v2 04/29] migration: Return the saved state from global_state_store Fabiano Rosas
2023-10-25 10:19   ` Daniel P. Berrangé
2023-10-23 20:35 ` [PATCH v2 05/29] migration: Introduce global_state_store_once Fabiano Rosas
2023-10-23 20:35 ` [PATCH v2 06/29] migration: Add auto-pause capability Fabiano Rosas
2023-10-24  5:25   ` Markus Armbruster
2023-10-24 18:12     ` Fabiano Rosas
2023-10-25  5:33       ` Markus Armbruster
2023-10-25  8:48   ` Daniel P. Berrangé
2023-10-25 13:57     ` Fabiano Rosas
2023-10-25 14:20       ` Daniel P. Berrangé
2023-10-25 14:58         ` Peter Xu
2023-10-25 15:25           ` Daniel P. Berrangé
2023-10-25 15:36             ` Peter Xu
2023-10-25 15:40               ` Daniel P. Berrangé
2023-10-25 17:20                 ` Peter Xu
2023-10-25 17:31                   ` Daniel P. Berrangé
2023-10-25 19:28                     ` Peter Xu
2023-10-23 20:35 ` [PATCH v2 07/29] migration: Run "file:" migration with a stopped VM Fabiano Rosas
2023-10-23 20:35 ` [PATCH v2 08/29] tests/qtest: File migration auto-pause tests Fabiano Rosas
2023-10-23 20:35 ` [PATCH v2 09/29] io: add and implement QIO_CHANNEL_FEATURE_SEEKABLE for channel file Fabiano Rosas
2023-10-23 20:35 ` [PATCH v2 10/29] io: Add generic pwritev/preadv interface Fabiano Rosas
2023-10-24  8:18   ` Daniel P. Berrangé
2023-10-24 19:06     ` Fabiano Rosas
2023-10-23 20:35 ` [PATCH v2 11/29] io: implement io_pwritev/preadv for QIOChannelFile Fabiano Rosas
2023-10-23 20:35 ` [PATCH v2 12/29] migration/qemu-file: add utility methods for working with seekable channels Fabiano Rosas
2023-10-25 10:22   ` Daniel P. Berrangé
2023-10-23 20:35 ` [PATCH v2 13/29] migration: fixed-ram: Add URI compatibility check Fabiano Rosas
2023-10-25 10:27   ` Daniel P. Berrangé
2023-10-31 16:06   ` Peter Xu
2023-10-23 20:35 ` [PATCH v2 14/29] migration/ram: Introduce 'fixed-ram' migration capability Fabiano Rosas
2023-10-24  5:33   ` Markus Armbruster
2023-10-24 18:35     ` Fabiano Rosas
2023-10-25  6:18       ` Markus Armbruster [this message]
2023-10-23 20:35 ` [PATCH v2 15/29] migration/ram: Add support for 'fixed-ram' outgoing migration Fabiano Rosas
2023-10-25  9:39   ` Daniel P. Berrangé
2023-10-25 14:03     ` Fabiano Rosas
2023-11-01 15:23     ` Peter Xu
2023-11-01 15:52       ` Daniel P. Berrangé
2023-11-01 16:24         ` Peter Xu
2023-11-01 16:37           ` Daniel P. Berrangé
2023-11-01 17:30             ` Peter Xu
2023-10-31 16:52   ` Peter Xu
2023-10-31 17:33     ` Fabiano Rosas
2023-10-31 17:59       ` Peter Xu
2023-10-23 20:35 ` [PATCH v2 16/29] migration/ram: Add support for 'fixed-ram' migration restore Fabiano Rosas
2023-10-25  9:43   ` Daniel P. Berrangé
2023-10-25 14:07     ` Fabiano Rosas
2023-10-31 19:03       ` Peter Xu
2023-11-01  9:26         ` Daniel P. Berrangé
2023-11-01 14:21           ` Peter Xu
2023-11-01 14:28             ` Daniel P. Berrangé
2023-11-01 15:00               ` Peter Xu
2023-11-06 13:18                 ` Fabiano Rosas
2023-11-06 21:00                   ` Peter Xu
2023-11-07  9:02                     ` Daniel P. Berrangé
2023-10-31 19:09   ` Peter Xu
2023-10-31 20:00     ` Fabiano Rosas
2023-10-23 20:35 ` [PATCH v2 17/29] tests/qtest: migration-test: Add tests for fixed-ram file-based migration Fabiano Rosas
2023-10-23 20:35 ` [PATCH v2 18/29] migration/multifd: Allow multifd without packets Fabiano Rosas
2023-10-23 20:35 ` [PATCH v2 19/29] migration/multifd: Add outgoing QIOChannelFile support Fabiano Rosas
2023-10-25  9:52   ` Daniel P. Berrangé
2023-10-25 14:12     ` Fabiano Rosas
2023-10-25 14:23       ` Daniel P. Berrangé
2023-10-25 15:00         ` Fabiano Rosas
2023-10-25 15:26           ` Daniel P. Berrangé
2023-10-31 20:11   ` Peter Xu
2023-10-23 20:35 ` [PATCH v2 20/29] migration/multifd: Add incoming " Fabiano Rosas
2023-10-25 10:29   ` Daniel P. Berrangé
2023-10-25 14:18     ` Fabiano Rosas
2023-10-31 21:28   ` Peter Xu
2023-10-23 20:36 ` [PATCH v2 21/29] migration/multifd: Add pages to the receiving side Fabiano Rosas
2023-10-31 22:10   ` Peter Xu
2023-10-31 23:18     ` Fabiano Rosas
2023-11-01 15:55       ` Peter Xu
2023-11-01 17:20         ` Fabiano Rosas
2023-11-01 17:35           ` Peter Xu
2023-11-01 18:14             ` Fabiano Rosas
2023-10-23 20:36 ` [PATCH v2 22/29] io: Add a pwritev/preadv version that takes a discontiguous iovec Fabiano Rosas
2023-10-24  8:50   ` Daniel P. Berrangé
2023-10-23 20:36 ` [PATCH v2 23/29] migration/ram: Add a wrapper for fixed-ram shadow bitmap Fabiano Rosas
2023-11-01 14:29   ` Peter Xu
2023-10-23 20:36 ` [PATCH v2 24/29] migration/ram: Ignore multifd flush when doing fixed-ram migration Fabiano Rosas
2023-10-25  9:09   ` Daniel P. Berrangé
2023-10-23 20:36 ` [PATCH v2 25/29] migration/multifd: Support outgoing fixed-ram stream format Fabiano Rosas
2023-10-25  9:23   ` Daniel P. Berrangé
2023-10-25 14:21     ` Fabiano Rosas
2023-10-23 20:36 ` [PATCH v2 26/29] migration/multifd: Support incoming " Fabiano Rosas
2023-10-23 20:36 ` [PATCH v2 27/29] tests/qtest: Add a multifd + fixed-ram migration test Fabiano Rosas
2023-10-23 20:36 ` [PATCH v2 28/29] migration: Add direct-io parameter Fabiano Rosas
2023-10-24  5:41   ` Markus Armbruster
2023-10-24 19:32     ` Fabiano Rosas
2023-10-25  6:23       ` Markus Armbruster
2023-10-25  8:44       ` Daniel P. Berrangé
2023-10-25 14:32         ` Fabiano Rosas
2023-10-25 14:43           ` Daniel P. Berrangé
2023-10-25 17:30             ` Fabiano Rosas
2023-10-25 17:45               ` Daniel P. Berrangé
2023-10-25 18:10                 ` Fabiano Rosas
2023-10-30 22:51             ` Fabiano Rosas
2023-10-31  9:03               ` Daniel P. Berrangé
2023-10-31 13:05                 ` Fabiano Rosas
2023-10-31 13:45                   ` Daniel P. Berrangé
2023-10-31 14:33                     ` Fabiano Rosas
2023-10-31 15:22                       ` Daniel P. Berrangé
2023-10-31 15:52                         ` Fabiano Rosas
2023-10-31 15:58                           ` Daniel P. Berrangé
2023-10-31 19:05                             ` Fabiano Rosas
2023-11-01  9:30                               ` Daniel P. Berrangé
2023-11-01 12:16                                 ` Fabiano Rosas
2023-11-01 12:23                                   ` Daniel P. Berrangé
2023-11-01 12:30                                     ` Fabiano Rosas
2023-10-24  8:33   ` Daniel P. Berrangé
2023-10-24 19:06     ` Fabiano Rosas
2023-10-25  9:07   ` Daniel P. Berrangé
2023-10-25 14:48     ` Fabiano Rosas
2023-10-25 15:22       ` Daniel P. Berrangé
2023-10-23 20:36 ` [PATCH v2 29/29] tests/qtest: Add a test for migration with direct-io and multifd Fabiano Rosas
2023-10-25  9:25   ` Daniel P. Berrangé

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=87sf5zkywd.fsf@pond.sub.org \
    --to=armbru@redhat.com \
    --cc=berrange@redhat.com \
    --cc=cfontana@suse.de \
    --cc=eblake@redhat.com \
    --cc=farosas@suse.de \
    --cc=leobras@redhat.com \
    --cc=peterx@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.