Commits
Andrey Mirkin authored and Pavel Emelyanov committed 21644501b46
CPT: create kernel threads in VE0 context In current implementation master process which performs checkpointing has owner_env set to VE0 and exec_env set to VE. All auxiliary kernel threads are created with exec_env set to VE and owner_env set to VE0, so after the do_fork_pid() we have the follwing: * new thread has owner_env == ve0, exec env == ve * its pid belongs to ve (pid->veid != 0) That is why if ve_enter() in thread fails, then we hit BUG_ON in release_task -> detach_pid -> free_pid sequence, since task owner env != pid's veid. When enter succeeds the task's owner env becomes ve and this BUG_ON is not triggered. To solve this problem exec_env is switched to VE before kernel thread creation and switched back after. Veid is passed to kernel via args. All kernel threads are created with CLONE_VFORK to be sure that parent process will not exit before doing exec() in thread. Bug #97124 Signed-off-by: Pavel Emelyanov <xemul@openvz.org>