[CRIU] Re: [PATCH 1/2] protobuf: Convert vma_entry to PB format

Pavel Emelyanov xemul at parallels.com
Thu Jul 19 02:52:35 EDT 2012


On 07/19/2012 10:48 AM, Cyrill Gorcunov wrote:
> On Thu, Jul 19, 2012 at 10:44:49AM +0400, Pavel Emelyanov wrote:
>> On 07/19/2012 10:31 AM, Cyrill Gorcunov wrote:
>>> On Thu, Jul 19, 2012 at 07:19:43AM +0400, Pavel Emelyanov wrote:
>>>> On 07/18/2012 06:34 PM, Cyrill Gorcunov wrote:
>>>>>
>>>>> +/*
>>>>> + * A message where all members have fixed types gives us
>>>>> + * an ability to iterate over an array of such messages,
>>>>> + * since they all have same size.
>>>>
>>>> ? Where do we use this?
>>>
>>> In __export_restore_task to walk over self vmas and original vmas.
>>
>> OK. We do walk the VmaEntry array of structures in memory. But why we need
>> the fixed sizes for on-disk array?
> 
> Otherwise we need more intrusive changes over all code. Look, at moment
> we have
> 
> sigreturn_restore
> 	...
> 	ret = parse_smaps(pid, &self_vma_list, false);
> 	self_vmas_len = round_up((ret + 1) * sizeof(VmaEntry), PAGE_SIZE);
> 
> so if these entries are not constant sized we can't count that easy how
> much memory we need in restorer to carry all vmas.

The VmaEntry is always fixed size regardless of the on-disk format. The on-disk
entries (of unknown C-type) -- yes, variable. In memory one -- no, fixed.

> Or you mean something else I don't get?
> 
> 	Cyrill
> .
> 



More information about the CRIU mailing list