[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180716133506.GB2494@hirez.programming.kicks-ass.net>
Date: Mon, 16 Jul 2018 15:35:06 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Xunlei Pang <xlpang@...ux.alibaba.com>
Cc: Ingo Molnar <mingo@...hat.com>,
Frederic Weisbecker <frederic@...nel.org>,
Tejun Heo <tj@...nel.org>, baoyou.xie@...il.com,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] sched/cputime: Ensure accurate utime and stime ratio
in cputime_adjust()
On Mon, Jul 09, 2018 at 10:58:43PM +0800, Xunlei Pang wrote:
> If users access "/proc/pid/stat", the utime and stime ratio in the
> current SAMPLE period are excepted, but currently cputime_adjust()
> always calculates with the ratio of the WHOLE lifetime of the process.
>
> This results in inaccurate utime and stime in "/proc/pid/stat". For
> example, a process runs for a while with "50% usr, 0% sys", then
> followed by "100% sys". For later while, the following is excepted:
> 0.0 usr, 100.0 sys
> but we got:
> 10.0 usr, 90.0 sys
>
> This patch uses the accurate ratio in cputime_adjust() to address the
> issue. A new task_cputime type field is added in prev_cputime to record
> previous task_cputime so that we can get the elapsed times as the accurate
> ratio.
This still does not explain anything...
Powered by blists - more mailing lists