[CRIU] [PATCH 4/5] kdat: Cache kdat object into /run/criu.kdat (v3)

Pavel Emelyanov xemul at virtuozzo.com
Thu Apr 27 08:54:09 PDT 2017


On 04/27/2017 06:14 PM, Dmitry Safonov wrote:
> On 04/27/2017 05:58 PM, Pavel Emelyanov wrote:
>> Doing kerndat checks on every criu start is way too slow. We
>> need some way to speed this checks up on a particular box.
>>
>> As suggested by Andre, Dima and Mike let's try to keep the
>> collected kdat bits into some tmpfs file. Keeping it on
>> tmpfs would invaludate this cache on every machine reboot.
>>
>> There have been many suggestions how to generate this file,
>> my proposal is to create it once the kdat object is filled
>> by criu, w/o any explicit command. Optionally we can add
>> 'criu kdat --save|--drop' actions to manage this file.
>>
>> v2:
>> * don't ignore return code of write() (some glibcs complain)
>> * unlink tmp file in case rename failed
>>
>> v3:
>> * add one more magic into kerndat_s which is the 'date +%s'
>> * ignore any errors opening or saving cache. Only size/magic
>>    mismatch matters (and result in dropping the cache)
>> * cache file path is Makefile-configurable (RUNDIR)
>> * don't save cache if kerndat auto-detection failed
>>
>> Signed-off-by: Pavel Emelyanov <xemul at virtuozzo.com>
> 
> Reviewed-by: Dmitry Safonov <dsafonov at virtuozzo.com>
> 
> There is still one nit below, heh.
> 
>> ---
>>   Makefile.install       |  3 +-
>>   criu/Makefile.crtools  |  1 +
>>   criu/include/kerndat.h |  1 +
>>   criu/include/magic.h   |  6 ++++
>>   criu/kerndat.c         | 85 ++++++++++++++++++++++++++++++++++++++++++++++++++
>>   5 files changed, 95 insertions(+), 1 deletion(-)
>>
>> diff --git a/Makefile.install b/Makefile.install
>> index f1e5415..ddde93d 100644
>> --- a/Makefile.install
>> +++ b/Makefile.install
>> @@ -7,6 +7,7 @@ MANDIR		:= $(PREFIX)/share/man
>>   LIBDIR		:= $(PREFIX)/lib
>>   INCLUDEDIR	:= $(PREFIX)/include
>>   LIBEXECDIR	:= $(PREFIX)/libexec
>> +RUNDIR		:= /run
> 
> An optional nit: if this will be
> RUNDIR		?= /run
> then package maintainer will not need a patch to correct this according
> to distribution and just will need to run `make RUNDIR=<...>`

OK :)

Andrey, do you want me to send v4, or will fix this symbol yourself when merging?

-- Pavel



More information about the CRIU mailing list