[CRIU] [PATCH 8/9] tty: Use regular files engine to save paths to the peers, v4

Cyrill Gorcunov gorcunov at gmail.com
Fri Oct 17 05:26:35 PDT 2014


On Fri, Oct 17, 2014 at 04:19:20PM +0400, Pavel Emelyanov wrote:
> >>>  	/*
> >>> +	 * The image might have no reg file record in old CRIU, so
> >>> +	 * lets don't fail for a while. After a couple of releases
> >>> +	 * simply require the record to present.
> >>> +	 */
> >>> +	info->reg_d = find_file_desc_raw(FD_TYPES__REG, info->tfe->id);
> >>> +	if (!info->reg_d) {
> >>> +		info->reg_d = pty_alloc_reg(info, true);
> >>> +		if (!info->reg_d) {
> >>> +			pr_err("Can't generate new reg descriptor for id %#x\n",
> >>> +			       info->tfe->id);
> >>> +			return -1;
> >>> +		}
> >>> +	} else {
> >>> +		info->reg_d = collect_special_file(info->tfe->id);
> >>
> >> This results in double list lookup.
> > 
> > This gonna be pretty fast, it's hashed list. Look, the old interface should be deprecated
> > in a couple of releases I think and I will simply can use collect_special_file
> > withouth "try" (because now we can have images where no reg-entries are
> > present on disc and if I use collect_special_file now the user will
> > get an error message).
> 
> Then introduce the __collect_special_file() w/o the message printing.

If you insist, ok then (as to me this is useless, this lookup is cache-hot
and won't consume time).


More information about the CRIU mailing list