[CRIU] [PATCH] Add test case for code page sharing

Pavel Emelyanov xemul at parallels.com
Tue Apr 7 06:27:09 PDT 2015


>>> and restore only changed pages.
>>>
>>> static inline bool should_dump_page(VmaEntry *vmae, u64 pme)
>>> {
>>> ...
>>>         /*
>>>          * Optimisation for private mapping pages, that haven't
>>>          * yet being COW-ed
>>>          */
>>>         if (vma_entry_is(vmae, VMA_FILE_PRIVATE) && (pme & PME_FILE))
>>>                 return false;
>>
>> But that's the dump routine. For COW restore different code is used:
> 
> No. It's another case. We are talking about private file mappings. If
> processes don't change content, they access shared pages which are
> associated with a file. If a process tries to change a page, the kernel
> allocates a new page and copies the file page into the new page.

Ah, I see. Well, yes, CRIU touches one private executable page to inject
parasite routine into it. Then this page gets dumped into the image.

Are we talking about a single page here?

-- Pavel



More information about the CRIU mailing list