qemu-discuss
[Top][All Lists]
Advanced

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

Re: Snapshot customizing


From: Jayakrishna Vadayath
Subject: Re: Snapshot customizing
Date: Fri, 29 Jul 2022 11:25:40 -0700

I managed to set up a way to let QEMU know that I only want to restore dirty pages from the snapshot.
And I can verify that it works.

I looked quite a bit into migration/ram.c and found that I can copy and modify ram_find_and_save_block for my use case.

If my understanding is correct, I need to call find_dirty_pages to identify dirty pages and then store the results from the page search status variable.
Then I need to iteratively clear the dirty bits using the migration_bitmap_clear_dirty in a manner that is similar to save_host_page.
And these two steps have to be performed iteratively until the find_dirty_pages sets the flag to break this loop.

Is my understanding correct?

Thank you.
Jay

On Thu, Jul 28, 2022 at 3:03 AM Peter Maydell <peter.maydell@linaro.org> wrote:
On Wed, 27 Jul 2022 at 18:45, Jayakrishna Vadayath <jay@forallsecure.com> wrote:
> Yes I did profile it afterwards and found that the majority of time is being spent on loading the RAM.
> I'm running QEMU with "-m 1G" and I do see that there's close to 1 gigabyte of memory being loaded from the snapshot.
>
> In my use case, I need to repeatedly revert back to a snapshot after executing a small user-space program.
> I was wondering if it would be possible to identify the dirty pages in RAM after this execution and only restore those pages from the snapshot when a restore is encountered.
>
> I understand that this scenario might be very unique, but I just wanted to know if such an idea would be feasible or not.

Potentially most of the machinery is present for that (tracking dirty
pages); but it would probably be a moderate development effort to
get it connected up to handle the snapshot revert case correctly,
and as you say it's for an extremely niche use case.

thanks
-- PMM

reply via email to

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