[CRIU] [PATCH 2/3] mem: if no parent image persists, can't rely on it
Cyrill Gorcunov
gorcunov at gmail.com
Tue Apr 15 12:15:19 PDT 2014
On Tue, Apr 15, 2014 at 11:07:28PM +0400, Pavel Tikhomirov wrote:
> 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.
OK, as far as I remember, once the process is forked, its pte/pmd structures
become allocated but not present, once child attempt to read something, the
read-fault happened and the parent's page comes to child as "clean" one. If
the parent dirtified the page before the child's read happened, then child
will see the page as a clean one but its contents will be 1:1 of what its
parent currently having (I didn't look into the code so maybe missing some
details, hopefully xemul@ will correct me).
More information about the CRIU
mailing list