[CRIU] Avoid dumping specific VMA ranges

Rodrigo Bruno rbruno at gsd.inesc-id.pt
Mon Dec 5 01:52:17 PST 2016


Hi all,

thank you both for you help!

I ended up solving the problem with MADVISE_DONTNEED (which does not
require changes to CRIU).

I did not need to use compel but it looks like a great tool and it gave me
some ideas for future research :-)

Cheers,
rodrigo

2016-12-05 8:45 GMT+00:00 Pavel Emelyanov <xemul at virtuozzo.com>:

> On 12/04/2016 08:20 PM, Raghavendra Prabhu wrote:
> > Hi,
> >
> > I have seen similar problem manifesting in the form such as
> > https://bugs.launchpad.net/percona-server/+bug/1092645 wherein people
> > don't want large memory pools in their coredumps. In this case, they
> > mark it as MADV_DONTDUMP.  Is it good to  assume that whatever is not
> > required in the coredump is not good for checkpoint images either.  If
> > not MADV_DONTDUMP, /proc/$pid/coredump_filter is used.
> >
> > So, wondering if something like
> > https://gist.github.com/ronin13/59c6ffab786db7ef9e54db4fb29b4992 would
> > be useful here.
>
> I tend to agree, but ... from my perspective, pages that are not required
> in a core-dump might still be required for an application to work. So your
> patch is OK, but it required a CLI option to be turned on. Always silently
> dropping the MADV_DONTDUMP pages may cause problems.
>
> -- Pavel
>
> >
> > On Wed, Nov 30, 2016 at 11:17 AM, Pavel Emelyanov <xemul at virtuozzo.com>
> wrote:
> >> On 11/30/2016 12:47 PM, Rodrigo Bruno wrote:
> >>> Hi all,
> >>>
> >>> I am using CRIU to checkpoint JVMs with heaps > 10GB.
> >>>
> >>> I want to reduce the size of the checkpoint and I know that there are
> memory ranges that
> >>> although being allocated and touched by the JVM, represent garbage and
> could be discarted
> >>
> >> Heh... This is something I thought of long ago. The idea by that time
> was
> >> that we could ship a library that applications can link with, and, when
> >> criu dumps them, it can detect the library is there and call some code
> from
> >> victim task. So that application can do some preparatory work before
> being
> >> checkpointed. But this would require patching JVM :\
> >>
> >>> when dumping the JVM (don't worry, I can ensure that the JVM is
> stopped while running this operation).
> >>>
> >>> Q1. Does CRIU support this?
> >>
> >> Nope :)
> >>
> >>> Q2. Without changing CRIU, is there any way to achieve this? Could I
> change a page table
> >>> entry to force a page with garbage to be mapped to the zero page?
> >>
> >> Yes and no. There are no standard knobs for this, but (!) we have
> announced
> >> compel recently. With it you can cook a parasite code that would call
> >> MADVISE_DONTNEED on the desired ranges thus punching the holes in
> memory.
> >>
> >> -- Pavel
> >>
> >> _______________________________________________
> >> CRIU mailing list
> >> CRIU at openvz.org
> >> https://lists.openvz.org/mailman/listinfo/criu
> > .
> >
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openvz.org/pipermail/criu/attachments/20161205/d2a3f6a5/attachment.html>


More information about the CRIU mailing list