Commit 2d42c544 authored by Andrey Vagin's avatar Andrey Vagin Committed by Pavel Emelyanov

dump: save all vdso pages (v2)

If a vdso page was not accessed before dump, it's not present
and now it doesn't save in a dump image.
The vdso area is restored as VMA_ANON, it isn't an actual vdso more,
so when a not-present vdso page is accessed, a zero page would be mapped.

For this reason we should save all vdso pages in a image.

v2: make code more clear
Signed-off-by: 's avatarAndrey Vagin <avagin@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 5a0038a9
......@@ -104,12 +104,18 @@ static void sys_write_msg(const char *msg)
static inline int should_dump_page(VmaEntry *vmae, u64 pme)
{
return (pme & (PME_PRESENT | PME_SWAP)) &&
/*
* Optimisation for private mapping pages, that haven't
* yet being COW-ed
*/
!(vma_entry_is(vmae, VMA_FILE_PRIVATE) && (pme & PME_FILE));
if (vma_entry_is(vmae, VMA_AREA_VDSO))
return 1;
/*
* Optimisation for private mapping pages, that haven't
* yet being COW-ed
*/
if (vma_entry_is(vmae, VMA_FILE_PRIVATE) && (pme & PME_FILE))
return 0;
if (pme & (PME_PRESENT | PME_SWAP))
return 1;
return 0;
}
static int fd_pages = -1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment