[Devel] Re: [PATCH 5/8] checkpoint/restart of anonymous hugetlb mappings
Oren Laadan
orenl at cs.columbia.edu
Thu Sep 16 17:44:56 PDT 2010
On 09/14/2010 04:02 PM, Nathan Lynch wrote:
> Support checkpoint and restore of both private and shared
> hugepage-backed mappings established via mmap(MAP_HUGETLB). Introduce
> APIs for checkpoint and restart of individual huge pages which are to
> be used by the sysv SHM_HUGETLB c/r code.
>
> Signed-off-by: Nathan Lynch <ntl at pobox.com>
The code looks clean, but I need to learn more about HUGETLB
before I can say much...
Do you also have test-suite for this ?
[...]
> +static int hugetlb_dump_contents(struct ckpt_ctx *ctx, struct vm_area_struct *vma)
> +{
> + struct ckpt_hdr_hpage hdr;
> + unsigned long pageshift;
> + unsigned long pagesize;
> + unsigned long addr;
> + int ret;
> +
> + pageshift = huge_page_shift(hstate_vma(vma));
> + pagesize = vma_kernel_pagesize(vma);
> +
> + ckpt_hdr_hpage_init(&hdr, pageshift);
> +
> + for (addr = vma->vm_start; addr < vma->vm_end; addr += pagesize) {
> + struct page *page = NULL;
> +
> + down_read(&vma->vm_mm->mmap_sem);
> + ret = __get_user_pages(ctx->tsk, vma->vm_mm,
> + addr, 1, FOLL_DUMP | FOLL_GET,
> + &page, NULL);
> + /* FOLL_DUMP gives -EFAULT for holes */
> + if (ret == -EFAULT)
> + ret = 0;
With regular pages, this didn't always work, especially after they
slightly changed the semantics of FOLL_DUMP. So I introduced the
FOLL_DIRTY flag to detect dirty (non-zero) pages. I wonder if
something like that may be needed here too ?
[...]
Oren.
_______________________________________________
Containers mailing list
Containers at lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containers
More information about the Devel
mailing list