[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 5/7] Only calculate expected_time for stage 2
From: |
Orit Wasserman |
Subject: |
Re: [Qemu-devel] [PATCH 5/7] Only calculate expected_time for stage 2 |
Date: |
Thu, 14 Jun 2012 14:31:16 +0300 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:12.0) Gecko/20120430 Thunderbird/12.0.1 |
On 05/22/2012 09:32 PM, Juan Quintela wrote:
> ram_save_remaining() is an expensive operation when there is a lot of memory.
> So we only call the function when we need it.
>
> Signed-off-by: Juan Quintela <address@hidden>
> ---
> arch_init.c | 10 ++++++----
> 1 files changed, 6 insertions(+), 4 deletions(-)
>
> diff --git a/arch_init.c b/arch_init.c
> index 988adca..76a3d4e 100644
> --- a/arch_init.c
> +++ b/arch_init.c
> @@ -295,7 +295,6 @@ int ram_save_live(QEMUFile *f, int stage, void *opaque)
> ram_addr_t addr;
> uint64_t bytes_transferred_last;
> double bwidth = 0;
> - uint64_t expected_time = 0;
> int ret;
>
> if (stage < 0) {
> @@ -372,9 +371,12 @@ int ram_save_live(QEMUFile *f, int stage, void *opaque)
>
> qemu_put_be64(f, RAM_SAVE_FLAG_EOS);
>
> - expected_time = ram_save_remaining() * TARGET_PAGE_SIZE / bwidth;
> -
> - return (stage == 2) && (expected_time <= migrate_max_downtime());
> + if (stage == 2) {
> + uint64_t expected_time;
> + expected_time = ram_save_remaining() * TARGET_PAGE_SIZE / bwidth;
> + return expected_time <= migrate_max_downtime();
> + }
> + return 0;
> }
>
> static inline void *host_from_stream_offset(QEMUFile *f,
Reviewed-by: Orit Wasserman <address@hidden>
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: [Qemu-devel] [PATCH 5/7] Only calculate expected_time for stage 2,
Orit Wasserman <=