[Devel] [PATCH RH7 v3 0/2]

Valeriy Vdovin valeriy.vdovin at virtuozzo.com
Tue Jan 14 21:54:48 MSK 2020


This patch addresses the problem of varying views on start time 
of a resumed process between container and host. From a container
point of view the resumed process is the same old process with
the same old start time, which hasn't changed after suspend/resume.
>From a host point of view the resumed process is just a new one
with a new start_time. Both the host and the container want to
see start time that is only relevant to their context.

To support that we should teach the output of of /proc/pid/stat
to show container-related value from container context and host-
related value from host context.

The patch introduces new field to task_struct that stores container-
related start time value. It will be seen in /proc/pid/stat in case
if it was requested by a task, that's in ve cgroup. 
Setting this field can be done with prctl only from host or a
container task with pseudosuper flag set.

At suspend this value is dumped by criu and at restore it's set back
from a dump by criu.

Valeriy Vdovin (1):
  ve/proc: Added separate start time field to task_struct to show in
    container

 fs/proc/array.c            | 16 ++++------------
 include/linux/sched.h      |  5 +++++
 include/linux/ve.h         | 23 +++++++++++++++++++++++
 include/uapi/linux/prctl.h |  7 +++++++
 kernel/fork.c              | 13 +++++++++++++
 kernel/sys.c               | 23 +++++++++++++++++++++++
 kernel/ve/ve.c             |  2 ++
 7 files changed, 77 insertions(+), 12 deletions(-)

Valeriy Vdovin (2):
  dump/restore: Maintain proper start_time param
    from /proc/[pid]/stat for each task

 criu/cr-dump.c         | 57 +++++++++++++++++++++++++++++++++++++++
 criu/cr-restore.c      | 73 +++++++++++++++++++++++++++++++-------------------
 criu/include/crtools.h | 25 +++++++++++++++++
 images/core.proto      |  2 ++
 4 files changed, 130 insertions(+), 27 deletions(-)

-- 
1.8.3.1



More information about the Devel mailing list