[CRIU] [PATCH 2/3] mem: if no parent image persists, can't rely on it
Pavel Tikhomirov
snorcht at gmail.com
Tue Apr 15 12:15:11 PDT 2014
I mean that if we write to COW protected memory from parent, kernel creates
new copy for parent, and in child old copy becomes writable.
Best Regards, Tikhomirov Pavel.
2014-04-15 23:07 GMT+04:00 Pavel Tikhomirov <snorcht at gmail.com>:
> Please read this comment.
>
>
> Best Regards, Tikhomirov Pavel.
>
>
> 2014-04-15 17:43 GMT+04:00 Pavel Tikhomirov <snorcht at gmail.com>:
>
> Ok, but what if parent writes to memory first and gets COW'ed,
>> and child gets writable memory when access it.
>> It can result in no PF.
>>
>> Just an Idea, need to understand COW mechanism more precisely.
>>
>>
>> Best Regards, Tikhomirov Pavel.
>>
>>
>> 2014-04-15 17:03 GMT+04:00 Cyrill Gorcunov <gorcunov at gmail.com>:
>>
>> On Tue, Apr 15, 2014 at 04:48:33PM +0400, Pavel Tikhomirov wrote:
>>> > It seem to me, that clear_soft_dirty function for pte in kernel is
>>> called
>>> > only
>>> > if we had explicit write to /proc/pid/clear_refs. Only after that
>>> all
>>> > pages will
>>> > become write-protected and dirty tracking realy works, if new
>>> process was
>>> > created between snapshots, some part of its memory can be not write
>>> > protected so no PF generated for this part and some soft-dirty bits
>>> not
>>> > set,
>>> > isn't it?
>>>
>>> No, when new process created and executed -- new memory will all be
>>> marked
>>> as soft-dirty. If new process is created with fork() then its pages will
>>> be COW'ed and once write fault happened the page will be marked as soft
>>> dirty as far as I remember.
>>>
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openvz.org/pipermail/criu/attachments/20140415/6a6bcce8/attachment.html>
More information about the CRIU
mailing list