[Devel] [PATCH 0/2] Start time of a task inside a container.
Valeriy Vdovin
valeriy.vdovin at virtuozzo.com
Tue Dec 31 14:41:11 MSK 2019
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):
Added separate start time field to task_struct to show in container
fs/proc/array.c | 16 ++++------------
include/linux/sched.h | 5 +++++
include/uapi/linux/prctl.h | 9 +++++++++
kernel/fork.c | 20 ++++++++++++++++++++
kernel/sys.c | 22 ++++++++++++++++++++++
kernel/ve/ve.c | 27 +++++++++++++++++++++++++++
6 files changed, 87 insertions(+), 12 deletions(-)
Valeriy Vdovin (2):
Dump/restore start_time param from /proc/[pid]/stat for each task
criu/cr-dump.c | 49 +++++++++++++++++++++++++++++++++++++++++++++++++
criu/cr-restore.c | 40 ++++++++++++++++++++++++++++++++++++++++
images/core.proto | 2 ++
3 files changed, 91 insertions(+)
--
1.8.3.1
More information about the Devel
mailing list