Re: [RFC PATCH 1/1] mm: Another attempt to monitor task's memorychanges

From: Pavel Emelyanov
Date: Tue Apr 09 2013 - 11:08:46 EST


On 04/09/2013 02:30 AM, Andrew Morton wrote:
> On Fri, 05 Apr 2013 21:06:12 +0400 Pavel Emelyanov <xemul@xxxxxxxxxxxxx> wrote:
>
>> Hello,
>>
>> This is another attempt (previous one was [1]) to implement support for
>> memory snapshot for the the checkpoint-restore project (http://criu.org).
>> Let me remind what the issue is.
>>
>> << EOF
>> To create a dump of an application(s) we save all the information about it
>> to files, and the biggest part of such dump is the contents of tasks' memory.
>> However, there are usage scenarios where it's not required to get _all_ the
>> task memory while creating a dump. For example, when doing periodical dumps,
>> it's only required to take full memory dump only at the first step and then
>> take incremental changes of memory. Another example is live migration. We
>> copy all the memory to the destination node without stopping all tasks, then
>> stop them, check for what pages has changed, dump it and the rest of the state,
>> then copy it to the destination node. This decreases freeze time significantly.
>>
>> That said, some help from kernel to watch how processes modify the contents
>> of their memory is required. Previous attempt used ftrace to inform userspace
>> about memory being written to. This one is different.
>>
>> EOF
>
> Did you consider teaching the kernel to perform a strong hash on a
> page's contents so that userspace can do a before-and-after check to see
> if it changed?

I did (unless I misunderstood _your_ idea with hashes :( ), but judged, that
a single bit on a pte would be less cpu and memory consuming than calculating
and keeping 32/64 bits of hash value.


As far as all other comments are concerned -- thanks a LOT for the feedback!
I will address them all.


Thanks,
Pavel
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/