[CRIU] [PATCH 03/10] cgroup: only collect cgsets once

Tycho Andersen tycho.andersen at canonical.com
Thu Mar 3 06:43:53 PST 2016


On Thu, Mar 03, 2016 at 01:49:18PM +0300, Pavel Emelyanov wrote:
> Applied as bug fix, but have one question:
> 
> > @@ -685,7 +688,7 @@ int dump_task_cgroup(struct pstree_item *item, u32 *cg_id, struct parasite_dump_
> >  	if (parse_task_cgroup(pid, args, &ctls, &n_ctls))
> >  		return -1;
> >  
> > -	cs = get_cg_set(&ctls, n_ctls);
> > +	cs = get_cg_set(&ctls, n_ctls, &existed);
> >  	if (!cs)
> >  		return -1;
> >  
> > @@ -705,7 +708,7 @@ int dump_task_cgroup(struct pstree_item *item, u32 *cg_id, struct parasite_dump_
> >  		 * The on-stack ctls is moved into cs inside
> >  		 * the get_cg_set routine.
> >  		 */
> > -		if (cs != criu_cgset && collect_cgroups(&cs->ctls))
> > +		if (cs != criu_cgset && !existed && collect_cgroups(&cs->ctls))
> >  			return -1;
> >  	}
> >  
> 
> Maybe it's better to call collect_cgroups() right in get_cg_set()?

Yes, probably so. I'll send a patch.

Tycho


More information about the CRIU mailing list