[Devel] [PATCH rh7] vecalls: fix VZCTL_GET_CPU_STAT uptime_jif scale

Vladimir Davydov vdavydov at parallels.com
Mon Sep 28 02:46:42 PDT 2015


ve->start_time is in jiffies, therefore we must use
jiffies_64_to_clock_t helper in order to convert it to clock_t.

https://jira.sw.ru/browse/PSBM-28811

Signed-off-by: Vladimir Davydov <vdavydov at parallels.com>
---
 kernel/ve/vecalls.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/ve/vecalls.c b/kernel/ve/vecalls.c
index 9e866153cc2d..537fc4aa964b 100644
--- a/kernel/ve/vecalls.c
+++ b/kernel/ve/vecalls.c
@@ -128,7 +128,7 @@ static int ve_get_cpu_stat(envid_t veid, struct vz_cpu_stat __user *buf)
 
 	vstat->uptime_clk = ve_get_uptime(ve);
 
-	vstat->uptime_jif = (unsigned long)cputime64_to_clock_t(
+	vstat->uptime_jif = (unsigned long)jiffies_64_to_clock_t(
 				get_jiffies_64() - ve->start_jiffies);
 	for (i = 0; i < 3; i++) {
 		tmp = avenrun[i] + (FIXED_1/200);
-- 
2.1.4




More information about the Devel mailing list