[CRIU] [PATCH] mem: Don't track memory changes if --track-mem is not specified

Cyrill Gorcunov gorcunov at gmail.com
Thu Jan 16 03:11:19 PST 2014


On Thu, Jan 16, 2014 at 03:07:55PM +0400, Pavel Emelyanov wrote:
> >> @@ -81,6 +77,17 @@ static struct mem_snap_ctx *mem_snap_init(struct parasite_ctl *ctl)
> >>  	int p_fd, pm_fd;
> >>  	PagemapHead *h;
> >>  
> >> +	/*
> >> +	 * If we're not tracking memory changes, then it doesn't
> >> +	 * matter whether we have parent images or not. Just
> >> +	 * proceed with full memory dump.
> >> +	 */
> >> +
> >> +	if (!opts.track_mem)
> >> +		return NULL;
> >> +
> >> +	BUG_ON(!kerndat_has_dirty_track);
> > 
> > Are these BUG_ON really needed? I mean what happen if we drop them?
> 
> We will proceed reading pmes with soft-dirty bits containing zeroes,
> i.e. -- spoiling the memory dump. Not to do this we ban track_mem
> for kernels w/o soft-dirty in kerndat_init() so these bug-ons are
> just to reflect that fact.

OK, thanks!

Acked-by: Cyrill Gorcunov <gorcunov at openvz.org>


More information about the CRIU mailing list