Open Yangfisher1 opened 2 years ago
Using a hybrid way, as keeping the anonymous memory area with sys_pread
passed the test with sudo ./zdtm.py run -a
.
Cc: @checkpoint-restore/maintainers
This should not be a default behaviour, but we can think on adding a separate mode for that.
We may need to introduce a new format for page.img, otherwise we can end up with thousands of thousands mappings. // Just thinking aloud .
Yes, I believe that adding a parameter like criu restore -D checkpoint/ --on-demand
and then using the sys_mmap
to restore is properly in some case where you don't need to load all the memory at once.
A friendly reminder that this issue had no activity for 30 days.
Sorry in advance if I'm asking something obvious.
Am I right that this approach with switching from preadv to mmap would make mappings, which were anonymous before c/r, become file mappings after c/r with backing file referring to criu image file?
I chose to use a hybrid way to solve this problem, because the zdtm test would check these state. I have already made a pull request #1711 , but there're still few bugs need to fix.
Hey, about two months ago I started to use criu as a part of our own project. We noticed that when restore the process, loading process memory from
page.img
just loads all pages, whose code is incriu/pie/restorer.c
, line 1535,r = sys_preadv(args->vma_ios_fd, iovs, nr, rio->off);
Considering that our work is related to serverless, we thought this was totally unnecessary to load all pages at once. Instead, we can use an "on-demand" way by changing thesys_preadv
tosys_mmap
, which has been introduced by a paper Replayable Execution Optimized for Page Sharing for a Managed Runtime Environment, in Section 4, Figure 8. We implemented the algorithm and tested for some simple program to dump and restore, it worked well. So I think it might be a new feature to restore a process usingsys_mmap
. But when I tested for this, it didn't pass the testzdtm.py
. In fact, it failed at the very beginning of the test. I checked the code and found out the reason it failed was the maps check incheck_visible_state
, which will check the status of a program before and after dump+restore. However, after the restore changed, at this phase, we changed some anonymous memory area which was now mapped topage.img
, so the check failed. So I'm wondering that is it possible for this to become a new feature in criu, or you just have tried and it didn't perform well. And I think that I can still use a hybrid way to pass the exam(just still keep the anonymous memory area using pread). But anyway, I want to hear your advice at first. Thanks!