diff options
author | Bui Quang Minh <minhquangbui99@gmail.com> | 2022-05-08 12:04:26 +0300 |
---|---|---|
committer | Andrei Vagin <avagin@google.com> | 2022-05-13 03:55:46 +0300 |
commit | df67400a7b1da90187990f0344e53cc7f253c671 (patch) | |
tree | 28eda8d0e3fae3e599f7ab453aa9800cdf16da4d /criu | |
parent | 03539d4d3c4f36b367815f8da856e57f5699c620 (diff) |
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>
Diffstat (limited to 'criu')
-rw-r--r-- | criu/mem.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/criu/mem.c b/criu/mem.c index 136439518..ab86a1f6d 100644 --- a/criu/mem.c +++ b/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; |