lkml.org 
[lkml]   [2011]   [Dec]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: Commit 1e5a74059f9 broke utime measurement of ptraced() processes
Date
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?

----- 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) -----


\
 
 \ /
  Last update: 2011-12-27 08:29    [W:0.127 / U:0.268 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site