mirror of
https://github.com/checkpoint-restore/criu
synced 2025-08-30 22:05:36 +00:00
mem: Skip pre-dumping on hugetlb mappings
As private hugetlb mappings are not pre-mapped, the content of them is restored in the the restorer which cannot use page_read->read_pages. As a result, we cannot recursively read the content of pre-dumped image in the parent directory and use preadv to read the content from the last dumped image only. Therefore, it may freeze while restoring when the content of mapping is in pre-dumped image in parent directory. We need to skip pre-dumping on hugetlb mappings to resolve the issue. Suggested-by: Alexander Mikhalitsyn <alexander.mikhalitsyn@virtuozzo.com> Signed-off-by: Bui Quang Minh <minhquangbui99@gmail.com>
This commit is contained in:
committed by
Andrei Vagin
parent
9066f87417
commit
b26e1fdbf7
15
criu/mem.c
15
criu/mem.c
@@ -246,6 +246,12 @@ prep_dump_pages_args(struct parasite_ctl *ctl, struct vm_area_list *vma_area_lis
|
||||
*/
|
||||
if (vma_entry_is(vma->e, VMA_AREA_AIORING) && skip_non_trackable)
|
||||
continue;
|
||||
/*
|
||||
* We totally ignore MAP_HUGETLB on pre-dump.
|
||||
* See also generate_vma_iovs() comment.
|
||||
*/
|
||||
if ((vma->e->flags & MAP_HUGETLB) && skip_non_trackable)
|
||||
continue;
|
||||
if (vma->e->prot & PROT_READ)
|
||||
continue;
|
||||
|
||||
@@ -402,7 +408,14 @@ static int generate_vma_iovs(struct pstree_item *item, struct vma_area *vma, str
|
||||
has_parent = false;
|
||||
}
|
||||
|
||||
if (vma_entry_is(vma->e, VMA_AREA_AIORING)) {
|
||||
/*
|
||||
* We want to completely ignore these VMA types on the pre-dump:
|
||||
* 1. VMA_AREA_AIORING because it is not soft-dirty trackable (kernel writes)
|
||||
* 2. MAP_HUGETLB mappings because they are not premapped and we can't use
|
||||
* parent images from pre-dump stages. Instead, the content is restored from
|
||||
* the parasite context using full memory image.
|
||||
*/
|
||||
if (vma_entry_is(vma->e, VMA_AREA_AIORING) || vma->e->flags & MAP_HUGETLB) {
|
||||
if (pre_dump)
|
||||
return 0;
|
||||
has_parent = false;
|
||||
|
Reference in New Issue
Block a user