[RHEL8,COMMIT] ve/time: Add comment in ve_start_container() on start time initialization

Submitted by Konstantin Khorenko on Oct. 14, 2020, 12:50 p.m.

Details

Message ID 202010141250.09ECoIpU1528924@finist-co8.sw.ru
State New
Series "ve/time: first patchset for times virtualization in CT"
Headers show

Commit Message

Konstantin Khorenko Oct. 14, 2020, 12:50 p.m.
The commit is pushed to "branch-rh8-4.18.0-193.6.3.vz8.4.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh8-4.18.0-193.6.3.vz8.4.12
------>
commit 957f72c6b846e1d3fdf9072080fecbd10d08d5ad
Author: Konstantin Khorenko <khorenko@virtuozzo.com>
Date:   Tue Oct 6 19:20:45 2020 +0300

    ve/time: Add comment in ve_start_container() on start time initialization
    
    Fixes: e931118f8139 ("ve: Add ve cgroup and ve_hook subsys")
    
    Signed-off-by: Konstantin Khorenko <khorenko@virtuozzo.com>
---
 kernel/ve/ve.c | 5 +++++
 1 file changed, 5 insertions(+)

Patch hide | download patch | download mbox

diff --git a/kernel/ve/ve.c b/kernel/ve/ve.c
index 1688407562d4..ac2252445841 100644
--- a/kernel/ve/ve.c
+++ b/kernel/ve/ve.c
@@ -398,6 +398,11 @@  static int ve_start_container(struct ve_struct *ve)
 	if (task_active_pid_ns(tsk) != tsk->nsproxy->pid_ns_for_children)
 		return -ECHILD;
 
+	/*
+	 * Setup uptime for new containers only, if restored
+	 * the value won't be zero here already but setup from
+	 * cgroup write while resuming the container.
+	 */
 	if (ve->start_time == 0) {
 		ve->start_time = tsk->start_time;
 		ve->real_start_time = tsk->real_start_time;