[CRIU] [PATCH cr] dump: save all vdso pages
Andrew Vagin
avagin at parallels.com
Mon Aug 20 05:57:33 EDT 2012
Pls, ignore this patch
On Mon, Aug 20, 2012 at 01:55:07PM +0400, Andrey Vagin wrote:
>
> 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.
>
> Signed-off-by: Andrey Vagin <avagin at openvz.org>
> ---
> parasite.c | 5 +++--
> test/zdtm.sh | 4 +++-
> 2 files changed, 6 insertions(+), 3 deletions(-)
>
> diff --git a/parasite.c b/parasite.c
> index cb9bbe5..982c037 100644
> --- a/parasite.c
> +++ b/parasite.c
> @@ -104,12 +104,13 @@ static void sys_write_msg(const char *msg)
>
> static inline int should_dump_page(VmaEntry *vmae, u64 pme)
> {
> - return (pme & (PME_PRESENT | PME_SWAP)) &&
> + return (vma_entry_is(vmae, VMA_AREA_VDSO)) ||
> + ((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));
> + !(vma_entry_is(vmae, VMA_FILE_PRIVATE) && (pme & PME_FILE)));
> }
>
> static int fd_pages = -1;
> diff --git a/test/zdtm.sh b/test/zdtm.sh
> index 71925a9..f495884 100644
> --- a/test/zdtm.sh
> +++ b/test/zdtm.sh
> @@ -35,6 +35,7 @@ static/pstree
> static/caps00
> static/cmdlinenv00
> static/socket_listen
> +static/packet_sock
> static/socket_udp
> static/socket6_udp
> static/socket_udplite
> @@ -222,6 +223,7 @@ EOF
> echo Dump $PID
> mkdir -p $ddump
> save_fds $PID $ddump/dump.fd
> + read
> setsid $CRTOOLS dump -x --evasive-devices -D $ddump -o dump.log -v 4 -t $PID $args $ARGS || {
> echo WARNING: process $tname is left running for your debugging needs
> return 1
> @@ -235,7 +237,7 @@ EOF
>
> echo Restore $PID
> setsid $CRTOOLS restore --log-pid -x -D $ddump -o restore.log -v 4 -d -t $PID $args || return 2
> -
> + read
> save_fds $PID $ddump/restore.fd
> diff_fds $ddump/dump.fd $ddump/restore.fd || return 2
> fi
> _______________________________________________
> CRIU mailing list
> CRIU at openvz.org
> https://openvz.org/mailman/listinfo/criu
More information about the CRIU
mailing list