Messages in this thread | | | From | Артем Анисимов <> | Subject | Re: Commit 1e5a74059f9 broke utime measurement of ptraced() processes | Date | Tue, 27 Dec 2011 11:30:36 +0300 |
| |
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) -----
| |