[CRIU] [PATCH 06/19] pstree: Bind CoreEntry to pstree item

Cyrill Gorcunov gorcunov at openvz.org
Wed Feb 27 08:00:34 EST 2013


On Wed, Feb 27, 2013 at 04:21:59PM +0400, Pavel Emelyanov wrote:
> >>
> >> why not simply pull threads regs in the same manner?
> > 
> > Could you please enlight me here? 
> 
> My question is -- we do have code, that fetches regs for master threads
> at some time in the dump beginning. Why do we need some complex code
> rework to fetch sub-threads regs as well in the same place?

Hmm. Lets double check.

1) Before this set we fetch task registers in two places

dump_task_core_all
  get_task_regs(pid, core, ctl);

	Here we save thread leader registers, which are
	cached in ctl variable from parasite injection
	code

dump_task_thread
  get_task_regs(pid, core, NULL)

	Here we save them for every thread but the leader

Bot helpers dump_task_core_all and dump_task_thread are
caller after parasite being injected.

With this set applied, we save all registers right after
the dumpee threads (all threads) are seized but parasite
is not yet injected. So the only oddity in new code I see
it that we will have a redundant copy of registers for
thread leader, but overall picture become more clear

collect threads
  seize them
    fetch registers

so I think it's rather a benefit, and it only looks
complex becuase of patch itself, in resulting code
it should be more clear. Agreed?


More information about the CRIU mailing list