Re: [PATCH RFC] time,signal: protect resource use statistics with seqlock

Peter Zijlstra
2014-08-15T09:44:36Z

[-- Attachment #1: Type: text/plain, Size: 1352 bytes --]

On Fri, Aug 15, 2014 at 11:37:33AM +0200, Mike Galbraith wrote:
> On Fri, 2014-08-15 at 08:28 +0200, Peter Zijlstra wrote:
> > On Fri, Aug 15, 2014 at 07:19:31AM +0200, Mike Galbraith wrote:
> > > For the N threads doing this on N cores case, seems rq->lock hammering
> > > will still be a source of major box wide pain. Is there any correctness
> > > reason to add up unaccounted ->on_cpu beans, or is that just value
> > > added?
> >
> > That delta can be arbitrarily large with nohz_full. And without
> > nohz_full the error is nr_cpus*TICK_NSEC, which I bet is larger than the
> > reported clock resolution.
> >
> > Having a non-constant error bound is annoying for you never quite know
> > what to expect.
>
> Ah, yeah, that could get rather large.
>
> > Also; why do we care about PROCESS_CPUTIME? People should really not use
> > it. What are the 'valid' usecases you guys care about?
>
> I don't care much, said "don't do that" before I saw a similar big box
> problem had popped up with times().

Urgh, yes times().. Now I don't think we do very accurate accounting of
those particular numbers, so we could fudge some of that. Typically we
only do TICK_NSEC granularity accounting on user/system divide anyhow,
seeing how putting timestamp reads in the kernel<>user switch is
_expensive_ -- see NOHZ_FULL.

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]