[Devel] [PATCH rh7] vecalls: fix VZCTL_GET_CPU_STAT uptime_jif scale
Kirill Tkhai
ktkhai at odin.com
Mon Sep 28 03:46:40 PDT 2015
On 28.09.2015 12:46, Vladimir Davydov wrote:
> 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);
>
Reviewed-by: Kirill Tkhai <ktkhai at odin.com>
N.B. 2.6.32 does not need that, because cputime is in jiffies there.
More information about the Devel
mailing list