From: Martin Schwidefsky <schwidefsky@de.ibm.com>
To: Ingo Molnar <mingo@elte.hu>
Cc: Christian Borntraeger <borntraeger@de.ibm.com>,
Linus Torvalds <torvalds@linux-foundation.org>,
Andrew Morton <akpm@linux-foundation.org>,
linux-kernel@vger.kernel.org,
Jan Glauber <jang@linux.vnet.ibm.com>,
heiko.carstens@de.ibm.com, Paul Mackerras <paulus@samba.org>
Subject: Re: [accounting regression since rc1] scheduler updates
Date: Tue, 21 Aug 2007 14:57:03 +0200 [thread overview]
Message-ID: <1187701023.24279.40.camel@localhost> (raw)
In-Reply-To: <20070821122125.GA7910@elte.hu>
On Tue, 2007-08-21 at 14:21 +0200, Ingo Molnar wrote:
> hm, i think i must have used the wrong terminology, so let me describe
> what i mean, so that we can argue this more efficiently ;-)
Ok, seems we need to be a bit more precise.
> What i call "real time sched_clock()" is a sched_clock() that returns
> the GTOD (the real time) of the hypervisor. I.e. sched_clock() advances
> by 1 billion units every wall-clock second, in each guest.
Which is what we call the TOD clock.
> A "virtual time sched_clock()" is a sched_clock() that returns only the
> amount of time the virtual CPU was executed by the hypervisor. I.e. on a
> 3 times overloaded hypervisor with 3 guests it will advance 333 million
> nanoseconds per 1 wall-clock second, in each guest. (it is 'virtual'
> because the clock slows down as load goes up. In CFS-speak the virtual
> clock is the "fair-clock".)
We 100% agree that sched_clock() should be virtual.
> to me the right scheme for sched_clock() is the virtual variant: to
> return the load-scaled nanoseconds. That way CFS will be able to
> schedule fairly even if time has been "stolen" from a task [by virtue of
> the hypervisor scheduling away the guest context without giving any
> notice about this to the guest kernel] - because sched_clock() measures
> the virtual time that got allocated to that guest by the hypervisor.
Ok, this means we will need Jans patch that makes sched_clock() use the
cpu timer. You said that this change would require that scheduler_tick()
has to use virtual time as well, which would be the second patch.
And then we require a third patch that fixes the process accounting.
> [ here i'm assuming precise host and precise guest statistics (which is
> naturally the case if both are Linux), and in that context the virtual
> numbers very much make sense, and whether 'top' displays 100% for a
> sole CPU-bound task should be mostly a matter of tooling. ]
It is not only a matter of tooling. The tool needs to have enough,
precise information to actually return the requested information. If the
user want to know how much real cpu a process has used (and our user do
want to know that), the output of /proc/<pid>/stat fields 14-17 have to
contain the real cpu usage for user/system/cumulated user and cumulated
system time. If they would contain the virtual cpu usage you cannot tell
how much real cpu a process used, even if you have access to the steal
timer numbers. The reason is that you would have to synchronize the
scheduling points in the guest and the hypervisor to come up with
reasonable numbers. This is something we obviously do not want to do.
The output of /proc/<pid>/stat is what Christian and I are complaining
about. Since the introduction of CFS and VIRT_ACCOUNTING=y the output
of /proc/<pid>/stat has changed its meaning and in our opinion it is
wrong now.
--
blue skies,
Martin.
"Reality continues to ruin my life." - Calvin.
next prev parent reply other threads:[~2007-08-21 12:53 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-08-12 16:32 [git pull request] scheduler updates Ingo Molnar
2007-08-14 8:37 ` [accounting regression since rc1] " Christian Borntraeger
2007-08-16 8:17 ` [PATCH][RFC] Re: accounting regression since rc1 Christian Borntraeger
2007-08-20 15:45 ` [accounting regression since rc1] scheduler updates Ingo Molnar
2007-08-20 17:03 ` Martin Schwidefsky
2007-08-20 18:08 ` Ingo Molnar
2007-08-20 18:33 ` Martin Schwidefsky
2007-08-20 19:00 ` Balbir Singh
2007-08-20 19:05 ` Ingo Molnar
2007-08-21 7:20 ` Christian Borntraeger
2007-08-20 19:12 ` Ingo Molnar
2007-08-21 7:00 ` Christian Borntraeger
2007-08-21 9:18 ` Martin Schwidefsky
2007-08-20 23:07 ` Paul Mackerras
2007-08-21 2:18 ` Andi Kleen
2007-08-21 7:09 ` Ingo Molnar
2007-08-21 10:07 ` Andi Kleen
2007-08-21 10:20 ` Ingo Molnar
2007-08-21 11:15 ` Andi Kleen
2007-08-21 11:20 ` Ingo Molnar
2007-08-21 8:17 ` Christian Borntraeger
2007-08-21 8:42 ` Ingo Molnar
2007-08-21 9:11 ` Martin Schwidefsky
2007-08-21 9:34 ` Ingo Molnar
2007-08-21 9:48 ` Paul Mackerras
2007-08-21 10:38 ` Martin Schwidefsky
2007-08-21 11:36 ` Ingo Molnar
2007-08-21 11:58 ` Martin Schwidefsky
2007-08-21 10:39 ` Christian Borntraeger
2007-08-21 10:43 ` Christian Borntraeger
2007-08-21 11:15 ` Ingo Molnar
2007-08-21 11:24 ` Christian Borntraeger
2007-08-21 11:30 ` Ingo Molnar
2007-08-21 11:58 ` Christian Borntraeger
2007-08-21 12:21 ` Ingo Molnar
2007-08-21 12:57 ` Martin Schwidefsky [this message]
2007-08-21 11:25 ` Ingo Molnar
2007-08-22 7:50 ` Christian Borntraeger
2007-08-22 7:59 ` Ingo Molnar
[not found] ` <200708141032.47235.borntraeger@de.ibm.com>
[not found] ` <alpine.LFD.0.999.0708140835240.30176@woody.linux-foundation.org>
2007-08-14 18:19 ` Christian Borntraeger
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=1187701023.24279.40.camel@localhost \
--to=schwidefsky@de.ibm.com \
--cc=akpm@linux-foundation.org \
--cc=borntraeger@de.ibm.com \
--cc=heiko.carstens@de.ibm.com \
--cc=jang@linux.vnet.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=paulus@samba.org \
--cc=torvalds@linux-foundation.org \
/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