mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: xlpang@linux.alibaba.com, tglx@linutronix.de,
	frederic@kernel.org, lcapitulino@redhat.com,
	torvalds@linux-foundation.org, linux-kernel@vger.kernel.org,
	hpa@zytor.com, tj@kernel.org, mingo@kernel.org
Cc: linux-tip-commits@vger.kernel.org
Subject: Re: [tip:sched/core] sched/cputime: Ensure accurate utime and stime ratio in cputime_adjust()
Date: Mon, 16 Jul 2018 15:37:51 +0200	[thread overview]
Message-ID: <20180716133751.GC2494@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <tip-8d4c00dc38a8aa30dae8402955e55e7b34e74bc8@git.kernel.org>

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.

  reply	other threads:[~2018-07-16 13:38 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-09 14:58 [PATCH v2] " Xunlei Pang
2018-07-15 23:36 ` [tip:sched/core] " tip-bot for Xunlei Pang
2018-07-16 13:37   ` Peter Zijlstra [this message]
2018-07-16 16:11     ` Frederic Weisbecker
2018-07-16 17:41     ` Ingo Molnar
2018-07-17  4:08       ` Xunlei Pang
2018-07-23  9:21         ` Peter Zijlstra
2018-07-24 13:28           ` Xunlei Pang
2018-07-16 13:35 ` [PATCH v2] " Peter Zijlstra

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180716133751.GC2494@hirez.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=frederic@kernel.org \
    --cc=hpa@zytor.com \
    --cc=lcapitulino@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=tglx@linutronix.de \
    --cc=tj@kernel.org \
    --cc=torvalds@linux-foundation.org \
    --cc=xlpang@linux.alibaba.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome