lkml.org 
[lkml]   [2018]   [Jul]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [tip:sched/core] sched/cputime: Ensure accurate utime and stime ratio in cputime_adjust()
On Mon, Jul 16, 2018 at 03:37:51PM +0200, Peter Zijlstra wrote:
> On Sun, Jul 15, 2018 at 04:36:17PM -0700, tip-bot for Xunlei Pang wrote:
> > Commit-ID: 8d4c00dc38a8aa30dae8402955e55e7b34e74bc8
> > Gitweb: https://git.kernel.org/tip/8d4c00dc38a8aa30dae8402955e55e7b34e74bc8
> > Author: Xunlei Pang <xlpang@linux.alibaba.com>
> > AuthorDate: Mon, 9 Jul 2018 22:58:43 +0800
> > Committer: Ingo Molnar <mingo@kernel.org>
> > CommitDate: Mon, 16 Jul 2018 00:28:31 +0200
> >
> > sched/cputime: Ensure accurate utime and stime ratio in cputime_adjust()
> >
> > 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 get:
> >
> > 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.
>
> Ingo, please make this one go away. I still have no idae what the
> problem is and I've not had time to reverse engineer the patch.
>
> The previous (v1) Changelog was a pile of incoherent rambling and the
> above doesn't explain anything much.
>
> I want a clear description of the problem and a coherent explanation of
> the proposed solution without having to reverse engineer the actual
> patch.

I must confess I'm having trouble to understand what the real problem is.

\
 
 \ /
  Last update: 2018-07-16 18:13    [W:0.072 / U:0.332 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site