[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 04/15] Fold postcopy_ram_discard_range into ram_

From: Juan Quintela
Subject: Re: [Qemu-devel] [PATCH 04/15] Fold postcopy_ram_discard_range into ram_discard_range
Date: Wed, 25 Jan 2017 11:08:00 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux)

"Dr. David Alan Gilbert (git)" <address@hidden> wrote:
> From: "Dr. David Alan Gilbert" <address@hidden>
> I'd created this weird pair of:
>   ram_discard_range   that lived in migration/ram.c
>      Which is built target-dependent so can access the insides of
>      RAMBlock
>   postcopy_ram_discard_range
>      Which actually does the discard.
> Flatten these down into ram_discard_range, this relies on the
> CONFIG_MADVISE check to be sure we have the real DONTNEED madvise
> rather than the posix variant that isn't guaranteed to discard pages.
> Signed-off-by: Dr. David Alan Gilbert <address@hidden>

Reviewed-by: Juan Quintela <address@hidden>

> @@ -1877,7 +1879,15 @@ int ram_discard_range(MigrationIncomingState *mis,
>                           host_endaddr);
>              goto err;
>          }
> -        ret = postcopy_ram_discard_range(mis, host_startaddr, length);
> +        errno = ENOTSUP;
> +#if defined(CONFIG_MADVISE)
> +        ret = qemu_madvise(host_startaddr, length, QEMU_MADV_DONTNEED);
> +#endif

This really looks weird, we shouldn't arrive here if CONFIG_MADVISE is
not configured, no?

Later, Juan.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]