[CRIU] Combining pre-copy and post-copy

Pavel Emelyanov xemul at virtuozzo.com
Fri Jul 29 05:18:56 PDT 2016


On 07/28/2016 04:11 PM, Mike Rapoport wrote:
> On Wed, Jul 27, 2016 at 01:27:28PM +0200, Adrian Reber wrote:
>> Thanks for getting the remote uffd support into criu-dev.
>>
>> I am now looking at combining pre-copy and post-copy. Luckily there is
>> for each pagemap entry the status if the page is in a parent checkpoint
>> or not. Which makes it easier to decide if the page should be handled by
>> uffd or not.
>>
>> Unfortunately this information is not available in the restorer. The
>> restorer only gets a list of VMAs and if the page should handled by uffd
>> is decided by vma_entry_can_be_lazy()
>>
>>         return ((e->flags & MAP_ANONYMOUS) &&
>>                 (e->flags & MAP_PRIVATE) &&
>>                 !(vma_entry_is(e, VMA_AREA_VDSO)) &&
>>                 !(vma_entry_is(e, VMA_AREA_VSYSCALL)));
>>
>> Which has no information about parents. What would be the best way to
>> include the information if the page exists in a parent checkpoint and
>> therefore should not be handled by uffd?
> 
> I think that the best way is to make restore and uffd use the information
> in the pagemap to detect lazy and/or zero pages.
> For instance, the restore_priv_vma_content function should skip the entire
> lazy pagemap. And uffd initialization of relevant page sets should also
> rely on the pagemap flags rather than on vma_entry_can_be_lazy().

But why do we need the vma for this? When #PF happens we can find the pagemap
entry which has all we need.

>> Does VmaEntry already know about parents? Or do we need a new flag?
>>
>> 		Adrian
>>
> 
> .
> 



More information about the CRIU mailing list