[Devel] [PATCH rh8 3/5] ve/time: Fix VE uptime virtualization to use u64 start_time
Konstantin Khorenko
khorenko at virtuozzo.com
Thu Oct 8 18:22:01 MSK 2020
From: Cyrill Gorcunov <gorcunov at virtuozzo.com>
Fixes: a3c4d1d8f383 ("ve/time: Customize VE uptime")
Signed-off-by: Konstantin Khorenko <khorenko at virtuozzo.com>
+++
ve: Use @real_start_timespec in uptime_proc_show
uptime_proc_show uses bootbased clocks so we should use
@real_start_timespec here instead. Seems was a typo while
converting from pcs6 code.
In scope of
https://jira.sw.ru/browse/PSBM-41406
Signed-off-by: Cyrill Gorcunov <gorcunov at virtuozzo.com>
Reviewed-by: Vladimir Davydov <vdavydov at virtuozzo.com>
vdavydov@:
This hunk was a part of
diff-cpt-record-ct-boot-based-start-time-to-show-correct-uptime
which was skipped during rebase to RH7 because it was considered cpt-related.
(cherry picked from vz7 commit 55b9202e39282f2a21773fd1fd99317bc6e07ddd)
Signed-off-by: Konstantin Khorenko <khorenko at virtuozzo.com>
---
fs/proc/uptime.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/fs/proc/uptime.c b/fs/proc/uptime.c
index 9a08b8a92c13..bc07d42ce9f5 100644
--- a/fs/proc/uptime.c
+++ b/fs/proc/uptime.c
@@ -38,7 +38,7 @@ FIXME: to be reworked anyway in
static int uptime_proc_show(struct seq_file *m, void *v)
{
- struct timespec uptime;
+ struct timespec uptime, offset;
struct timespec64 idle;
if (ve_is_super(get_exec_env()))
@@ -58,9 +58,10 @@ FIXME: to be reworked anyway in
get_monotonic_boottime(&uptime);
#ifdef CONFIG_VE
if (!ve_is_super(get_exec_env())) {
+ offset = ns_to_timespec(get_exec_env()->real_start_time);
set_normalized_timespec(&uptime,
- uptime.tv_sec - get_exec_env()->start_timespec.tv_sec,
- uptime.tv_nsec - get_exec_env()->start_timespec.tv_nsec);
+ uptime.tv_sec - offset.tv_sec,
+ uptime.tv_nsec - offset.tv_nsec);
}
#endif
seq_printf(m, "%lu.%02lu %lu.%02lu\n",
--
2.28.0
More information about the Devel
mailing list