[CRIU] [PATCH 1/7] Adding --pre-dump-mode option

abhishek dubey dubeyabhishek777 at gmail.com
Sat Aug 31 15:21:26 MSK 2019


Hi Dmitry, Andrei,

On 28/08/19 10:14 PM, Dmitry Safonov wrote:
> Hi Abhishek,
>
> Thanks for doing this work
>
> On 8/25/19 2:58 AM, Abhishek Dubey wrote:
> [..]
>> +*--pre-dump-mode*='mode'::
>> +    There are two 'mode' to operate pre-dump algorithm. The 'splice' mode
>> +    is parasite based, whereas 'read' mode is based on process_vm_readv
>> +    syscall. The 'read' mode incurs reduced frozen time and reduced
>> +    memory pressure as compared to 'splice' mode. Default is 'splice' mode.
>> +
> It seems from the code that it's safe to do:
> pre-dump-1: splice-based
> pre-dump-2: read-based
> ...
>
> Could you add in doc that it's safe to mix those modes?

I have sent [PATCH 9/7] to cover this functionality.

Previously, either all pre-dumps need to be READ mode or SPLICE mode.

This patch adds functionality to run pre-dumps in any order in any mode.

Please read the comment for detailed explanation, why previous code was

breaking while handling mix of pre-dump-modes.

> Also, could you add a zdtm.py launch with this mode to cover it with
> Travis-CI? I think, the proper place would be in:
> scripts/travis/travis-tests
> And another line that will run "mixed" old-new predumps.
>
> That will make sure that further improvements don't break your work on
> new pre-dump mechanism.

With --mix-pre-dump option, this can be done now.

Once patch is approved, I will add in travis.

>
> [..]
>>   /*
>> + * Pre-dump variants
>> + */
>> +#define PRE_DUMP_SPLICE		1		/* Pre-dump using parasite */
>> +#define PRE_DUMP_READ			2		/* Pre-dump using process_vm_readv syscall */
>> +
>> +/*
>>    * Cgroup management options.
>>    */
>>   #define CG_MODE_IGNORE		(0u << 0)	/* Zero is important here */
>> @@ -81,6 +87,7 @@ struct cr_options {
>>   	int			evasive_devices;
>>   	int			link_remap_ok;
>>   	int			log_file_per_pid;
>> +	int			pre_dump_mode;
> Minor stilistic nit: Could we make it enum?
>
> enum pre_dump_mode {
>     PRE_DUMP_MODE_SPLICE = 0,
>     PRE_DUMP_MODE_READ,
> };
>
> Might be my preference, so not insisting.
Sure :)
>
> Thanks,
>            Dmitry


More information about the CRIU mailing list