[Devel] [PATCH RHEL COMMIT] ve/time: remove our per-ve times in favor of mainstream time-namespaces

Konstantin Khorenko khorenko at virtuozzo.com
Mon Oct 4 21:50:32 MSK 2021


The commit is pushed to "branch-rh9-5.14.vz9.1.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after ark-5.14
------>
commit c218bca9cfeb46b646547073430d8824a36cef6c
Author: Pavel Tikhomirov <ptikhomirov at virtuozzo.com>
Date:   Mon Oct 4 21:50:31 2021 +0300

    ve/time: remove our per-ve times in favor of mainstream time-namespaces
    
    https://jira.sw.ru/browse/PSBM-134393
    
    Signed-off-by: Pavel Tikhomirov <ptikhomirov at virtuozzo.com>
    
    ====================
    Patchset description:
    
    ve/time: switch from our ve-time to native timenamespace
    
    https://jira.sw.ru/browse/PSBM-134393
    
    As time-namespaces are a new and mainstreamed version of ve-time, it's
    time to switch to it.
    
    Notes:
    1) ve-time does not need configuration on start, though time namespace
       needs configuration (offset == -now).
    
    2) ve-time saved container start time but time namespaces save offset
       between host start time and container start time
       (offset == ve_start_time - now).
    
    3) criu already knows how to handle time namespaces, though we need to
       do a compatibility layer to convert our ve.clock_* to offsets in time
       namespace for pre-vz9 to vz9 migration.
    
    4) vdso time is already handled by time namespaces, though time
       namespace only virtualizes vvar page, so it should not intersect with
       our vdso virtualization for ve.os_release.
    
    https://jira.sw.ru/browse/PSBM-134393
    
    Cyrill Gorcunov (1):
      ve: Add interface for ve::clock_[monotonic|bootbased] adjustment
    
    Kirill Tkhai (2):
      ve/time: Use ve_relative_clock in times() syscall and /proc/[pid]/stat
      ve: Virtualize sysinfo
    
    Pavel Tikhomirov (1):
      ve/time: remove our per-ve times in favor of mainstream
        time-namespaces
    
    Valeriy Vdovin (1):
      ve/proc: Added separate start time field to task_struct to show in
        container
---
 include/linux/ve.h | 2 --
 kernel/ve/ve.c     | 9 ---------
 2 files changed, 11 deletions(-)

diff --git a/include/linux/ve.h b/include/linux/ve.h
index 496d90634a0e..dccf2108f79b 100644
--- a/include/linux/ve.h
+++ b/include/linux/ve.h
@@ -36,8 +36,6 @@ struct ve_struct {
 	struct rw_semaphore	op_sem;
 
 	/* per VE CPU stats*/
-	u64			start_time;		/* monotonic time */
-	u64			start_boottime;		/* boot based time */
 	u64			start_jiffies;		/* Deprecated */
 
 	struct nsproxy __rcu	*ve_ns;
diff --git a/kernel/ve/ve.c b/kernel/ve/ve.c
index a55ab14a1998..e510acf027f5 100644
--- a/kernel/ve/ve.c
+++ b/kernel/ve/ve.c
@@ -457,15 +457,6 @@ 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->start_boottime = tsk->start_boottime;
-	}
 	/* The value is wrong, but it is never compared to process
 	 * start times */
 	ve->start_jiffies = get_jiffies_64();


More information about the Devel mailing list