[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v1 06/13] migrate/ram: Discard new RAM when growing RAM block
From: |
David Hildenbrand |
Subject: |
Re: [PATCH v1 06/13] migrate/ram: Discard new RAM when growing RAM blocks and the VM is stopped |
Date: |
Fri, 21 Feb 2020 10:08:17 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 |
On 19.02.20 17:17, David Hildenbrand wrote:
> In case we grow our RAM after ram_postcopy_incoming_init() (e.g., when
> synchronizing the RAM block state with the migration source), the resized
> part would not get discarded. Let's perform that when being notified
> about a resize while postcopy has been advised and the guest is not
> running yet.
>
> Cc: "Dr. David Alan Gilbert" <address@hidden>
> Cc: Juan Quintela <address@hidden>
> Cc: Peter Xu <address@hidden>
> Signed-off-by: David Hildenbrand <address@hidden>
> ---
> migration/ram.c | 19 +++++++++++++++++++
> 1 file changed, 19 insertions(+)
>
> diff --git a/migration/ram.c b/migration/ram.c
> index 57f32011a3..cbd54947fb 100644
> --- a/migration/ram.c
> +++ b/migration/ram.c
> @@ -3722,6 +3722,25 @@ static void ram_mig_ram_block_resized(RAMBlockNotifier
> *n, void *host,
> return;
> }
>
> + /*
> + * Especially at the start of precopy on the migration target, before
> + * starting postcopy, we synchronize the RAM block sizes. Let's make sure
> + * that any resizes before starting the guest are properly handled by
> + * postcopy. Note: All other postcopy handling (e.g., registering
> handlers,
> + * disabling THP) happens after all resizes (e.g., during precopy) were
> + * performed.
> + */
I think it would be clearer to do a
ps >= POSTCOPY_INCOMING_ADVISE && ps < POSTCOPY_INCOMING_RUNNING
We really only want to do something when psotcopy has been advised but
the guest is not running yet.
Will look into that as I find ways to actually test this :)
--
Thanks,
David / dhildenb
- [PATCH v1 00/13] migrate/ram: Fix resizing RAM blocks while migrating, David Hildenbrand, 2020/02/19
- [PATCH v1 01/13] util: vfio-helpers: Factor out and fix processing of existing ram blocks, David Hildenbrand, 2020/02/19
- [PATCH v1 02/13] stubs/ram-block: Remove stubs that are no longer needed, David Hildenbrand, 2020/02/19
- [PATCH v1 03/13] numa: Teach ram block notifiers about resizeable ram blocks, David Hildenbrand, 2020/02/19
- [PATCH v1 04/13] numa: Make all callbacks of ram block notifiers optional, David Hildenbrand, 2020/02/19
- [PATCH v1 06/13] migrate/ram: Discard new RAM when growing RAM blocks and the VM is stopped, David Hildenbrand, 2020/02/19
- Re: [PATCH v1 06/13] migrate/ram: Discard new RAM when growing RAM blocks and the VM is stopped,
David Hildenbrand <=
- [PATCH v1 05/13] migrate/ram: Handle RAM block resizes during precopy, David Hildenbrand, 2020/02/19
- Re: [PATCH v1 05/13] migrate/ram: Handle RAM block resizes during precopy, David Hildenbrand, 2020/02/20
- Re: [PATCH v1 05/13] migrate/ram: Handle RAM block resizes during precopy, Peter Xu, 2020/02/20
- Re: [PATCH v1 05/13] migrate/ram: Handle RAM block resizes during precopy, David Hildenbrand, 2020/02/21
- Re: [PATCH v1 05/13] migrate/ram: Handle RAM block resizes during precopy, David Hildenbrand, 2020/02/21
- Re: [PATCH v1 05/13] migrate/ram: Handle RAM block resizes during precopy, David Hildenbrand, 2020/02/21
- Re: [PATCH v1 05/13] migrate/ram: Handle RAM block resizes during precopy, Peter Xu, 2020/02/21
Re: [PATCH v1 05/13] migrate/ram: Handle RAM block resizes during precopy, Dr. David Alan Gilbert, 2020/02/21