lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1285854460.1856.14.camel@holzheu-laptop>
Date:	Thu, 30 Sep 2010 15:47:40 +0200
From:	Michael Holzheu <holzheu@...ux.vnet.ibm.com>
To:	Roland McGrath <roland@...hat.com>
Cc:	Oleg Nesterov <oleg@...hat.com>,
	Martin Schwidefsky <schwidefsky@...ibm.com>,
	Shailabh Nagar <nagar1234@...ibm.com>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Venkatesh Pallipadi <venki@...gle.com>,
	Peter Zijlstra <a.p.zijlstra@...llo.nl>,
	Suresh Siddha <suresh.b.siddha@...el.com>,
	John stultz <johnstul@...ibm.com>,
	Thomas Gleixner <tglx@...utronix.de>,
	Balbir Singh <balbir@...ux.vnet.ibm.com>,
	Ingo Molnar <mingo@...e.hu>,
	Heiko Carstens <heiko.carstens@...ibm.com>,
	linux-s390@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [RFC][PATCH 09/10] taskstats: Fix exit CPU time accounting

Hello Roland,

On Wed, 2010-09-29 at 12:19 -0700, Roland McGrath wrote: 
> > > I would consider it to be a BUG() that the time is not accounted.
> > > Independent of the fact that a parent wants to see the SIGCHLD and
> > > the exit status of its child the process time of the child should be
> > > accounted, no?
> > 
> > I do not know. It doesn't look like a BUG(), I mean it looks as if
> > the code was intentionally written this way.
> 
> POSIX specifies this behavior: "If the child is never waited for (for
> example, if the parent has SA_NOCLDWAIT set or sets SIGCHLD to SIG_IGN),
> the resource information for the child process is discarded and not
> included in the resource information provided by getrusage()."

Thanks! That information was missing! Although still for me it not seems
to be a good decision to do it that way. Because of that it currently is
not possible to evaluate all consumed CPU time by looking at the current
processes. Time can simply disappear.

What about adding a new set of CPU time fields (e.g. cr-times) for the
cumulative "autoreap" children times to the signal struct and export
them via taskstats?

Then the following set of CPU times will give a complete picture (I also
added steal time (st) that is currently not accounted in Linux per
task):

* task->(u/s/st-time):
  Time that has been consumed by task itself

* task->signal->(c-u/s/st-time):
  Time that has been consumed by dead children of process where parent
  has done a sys_wait()

* task->signal->(u/s/st-time):
  Time that has been consumed by dead threads of thread group of process
  - NEW: Has to be exported via taskstats

* task->signal->(cr-u/s/st-time):
  Time that has been consumed by dead children that reaped 
  themselves, because parent ignored SIGCHLD or has set SA_NOCLDWAIT
  - NEW: Fields have to be added to signal struct
  - NEW: Has to be exported via taskstats

Michael

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ