mirror of
https://github.com/checkpoint-restore/criu
synced 2025-09-03 15:55:53 +00:00
mem: Skip premapping hugetlb mapping
As we cannot use mremap() to move the hugetlb mapping around until Linux kernel version 5.16, we need to skip premapping hugetlb mapping. Signed-off-by: Bui Quang Minh <minhquangbui99@gmail.com>
This commit is contained in:
committed by
Andrei Vagin
parent
8941b63a4b
commit
456e50b59b
@@ -733,6 +733,9 @@ static inline bool check_cow_vmas(struct vma_area *vma, struct vma_area *pvma)
|
|||||||
return false;
|
return false;
|
||||||
if (!vma_area_is_private(pvma, kdat.task_size))
|
if (!vma_area_is_private(pvma, kdat.task_size))
|
||||||
return false;
|
return false;
|
||||||
|
/* ... but not hugetlb mappings */
|
||||||
|
if (vma->e->flags & MAP_HUGETLB || pvma->e->flags & MAP_HUGETLB)
|
||||||
|
return false;
|
||||||
/* ... have growsdown and anon flags coincide */
|
/* ... have growsdown and anon flags coincide */
|
||||||
if ((vma->e->flags ^ pvma->e->flags) & (MAP_GROWSDOWN | MAP_ANONYMOUS))
|
if ((vma->e->flags ^ pvma->e->flags) & (MAP_GROWSDOWN | MAP_ANONYMOUS))
|
||||||
return false;
|
return false;
|
||||||
@@ -971,6 +974,9 @@ static int premap_priv_vmas(struct pstree_item *t, struct vm_area_list *vmas, vo
|
|||||||
if (!vma_area_is_private(vma, kdat.task_size))
|
if (!vma_area_is_private(vma, kdat.task_size))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
if (vma->e->flags & MAP_HUGETLB)
|
||||||
|
continue;
|
||||||
|
|
||||||
if (vma->pvma == NULL && pr->pieok && !vma_force_premap(vma, &vmas->h)) {
|
if (vma->pvma == NULL && pr->pieok && !vma_force_premap(vma, &vmas->h)) {
|
||||||
/*
|
/*
|
||||||
* VMA in question is not shared with anyone. We'll
|
* VMA in question is not shared with anyone. We'll
|
||||||
|
Reference in New Issue
Block a user