From: Andi Kleen <andi@firstfloor.org>
To: "Tomasz Noiński" <noix@sphere.pl>
Cc: linux-kernel@vger.kernel.org, timm@kip.uni-heidelberg.de,
arne.wiebalck@kip.uni-heidelberg.de
Subject: Re: more precise CPU time accounting for x86
Date: 17 Mar 2007 19:18:38 +0100 [thread overview]
Message-ID: <p73bqir7myp.fsf@bingen.suse.de> (raw)
In-Reply-To: <20070317164722.1fed2b27.noix@sphere.pl>
Tomasz Noiński <noix@sphere.pl> writes:
> Hi,
>
> I've written a small patch for more precise process CPU time accounting
> for processors with TSC.
>
> Currently, accounting is sample-based and it can be fooled by, for
> example, a process that always gives away the rest of it's timeslice.
RDTSC is unfortunately quite slow on some CPUs.
But we already use it in schedule for sched_clock(). I think
an interesting approach would be to use this information
and just sum it up in the task_struct. This would still not
account for interrupts and system time separately, but should
be relatively cheap and give more accurate time. Drawback would
be that user tools would need to be updated to read a "sys+user"
count.
BTW perfctrs on most x86 CPUs can count user/kernel separately,
unfortunately it is hard to find a performance counter that
matches real time well enough and they couldn't easily
separate interrupts vs systime belonging to the process.
-Andi
next prev parent reply other threads:[~2007-03-17 17:19 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-03-17 15:47 more precise CPU time accounting for x86 Tomasz Noiński
2007-03-17 18:18 ` Andi Kleen [this message]
2007-03-18 5:01 ` Stephen Rothwell
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=p73bqir7myp.fsf@bingen.suse.de \
--to=andi@firstfloor.org \
--cc=arne.wiebalck@kip.uni-heidelberg.de \
--cc=linux-kernel@vger.kernel.org \
--cc=noix@sphere.pl \
--cc=timm@kip.uni-heidelberg.de \
/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