From: Mike Galbraith <efault@gmx.de>
To: "Артем Анисимов" <aanisimov@inbox.ru>
Cc: linux-kernel@vger.kernel.org, a.p.zijlstra@chello.nl, mingo@elte.hu
Subject: Re: Commit 1e5a74059f9 broke utime measurement of ptraced() processes
Date: Tue, 27 Dec 2011 09:04:11 +0100 [thread overview]
Message-ID: <1324973051.5217.112.camel@marge.simson.net> (raw)
In-Reply-To: <201112271130.36907.aanisimov@inbox.ru>
On Tue, 2011-12-27 at 11:30 +0300, Артем Анисимов wrote:
> On Saturday 24 December 2011 10:42:46, Mike Galbraith wrote :
>
> >
> > > Also I'd like to know if there is a way to get reliable utime
> > > measurements in recent kernels.
> >
> > If wakeup preemption is undesirable, you could run SCHED_BATCH.
>
> > CPU utilization shifts with wakeup preemption, so there will be visible
> > effect when you change wakeup preemption in any way.
>
> Thanks, SCHED_BATCH does solve my problem. I'd like to modify the man page
> times (2) so that it includes a warning on utime of processes that wake each
> other. Do you find the following note correct?
Yeah, guess so. I'd leave out the "hand a few wakeup expense...",
that's just a small side effect of not wasting cycles doing very nearly
back to back clock updates for no good reason. The important thing to
note is that utilization is affected by sleep/wakeup patterns.
> ----- to be added to times (2) -----
> On Linux, the user time of a process depends on pattern of wakeups of the
> process. The scheduler is permitted to cut waker's CPU usage and hand a few
> wakeup expense cycles to the wakee that preempted. As a consequence, if two
> processes A and B wake each other frequently (e.g., they communicate via
> pipes, or by sending signals) then only the collective user time of A and B is
> well defined; individual user times of A and B can be arbitrarily
> redistributed between them. If this behaviour is undesirable then both
> processes need to use the SCHED_BATCH scheduler class, see
> sched_setscheduler(2).
> ----- to be added to times (2) -----
prev parent reply other threads:[~2011-12-27 8:04 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-19 12:19 Артем Анисимов
2011-12-20 13:39 ` Mike Galbraith
2011-12-24 7:26 ` Артем Анисимов
2011-12-24 7:42 ` Mike Galbraith
2011-12-27 8:30 ` Артем Анисимов
2011-12-27 8:04 ` Mike Galbraith [this message]
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=1324973051.5217.112.camel@marge.simson.net \
--to=efault@gmx.de \
--cc=a.p.zijlstra@chello.nl \
--cc=aanisimov@inbox.ru \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
/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
all inboxes | Powered by JetHome®