From: Arjan van de Ven <arjan@infradead.org>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Corrado Zoccolo <czoccolo@gmail.com>, linux-kernel@vger.kernel.org
Subject: Re: Negative values in /proc/latency_stats
Date: Tue, 3 Feb 2009 07:19:27 -0800 [thread overview]
Message-ID: <20090203071927.266e83a5@infradead.org> (raw)
In-Reply-To: <20090202205545.4e1a32ea.akpm@linux-foundation.org>
On Mon, 2 Feb 2009 20:55:45 -0800
Andrew Morton <akpm@linux-foundation.org> wrote:
[ I'm on a plane and writing a patch to fix some of the issues you
mention; I need to be tethered to test before sending]
>
> - It implements an up-to-1536-loops loop followed by an
> up-to-384-loops loop on a scheduler hotpath.
>
> All under spin_lock_irqsave()!
while you mention the theoretical worst case scenario numbers, the
reality isn't this bleak. it's a linear array that stores a chain, and
yes, the chain is searched lazy. but... the chain is stored "most
unique -> least unique", so typical complexity is a lot lower than what
you mention. And it is also only on when you are actually actively
tracing.
>
> - store_stacktrace() unnecessarily initalises trace.skip.
fixed in patch
>
> - account_scheduler_latency() should be an inline:
>
> if (unlikely(latencytop_enabled))
> __account_scheduler_latency(...);
borderline but fair; function calls are cheap (or even free in some
cases) but this one is in such a hotpath that this optimization makes
some sense.
>
> - ditto clear_all_latency_tracing()
this one is only called in slowpaths, so I wouldn't think this makes
sense.
>
> - it's schizophrenic in its placement of spaces around semicolons in
> `for' statements.
fixed in patch
>
> - it seems to only be implemented if CONFIG_FAIR_GROUP_SCHED=y.
this is a misunderstanding; sched_fair.c is not related to the fair
GROUP scheduler. It is the normal scheduler policy.
>
> - lstats_fops should be const.
fixed
> And it emits negative numbers too ;)
the problem with this one is that the numbers probably really ARE
negative... (but i need to test some more)
If time goes backwards during idle, the sleep time is considered
negative.... which I can understand will confuse humans.
The alternative possibility would be that we had a several-minutes
latency, which I consider unlikely.... the worst latency I've seen
under normal load is in the 10 second range, not the
hundreds-of-seconds or thousands-of-seconds range. And you'd think
people would notice such latencies and complain.
I'll see if I can just discard the "time goes backwards" cases rather
than propagating the insanity to userspace.
--
Arjan van de Ven Intel Open Source Technology Centre
For development, discussion and tips for power savings,
visit http://www.lesswatts.org
next prev parent reply other threads:[~2009-02-03 16:34 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-31 13:42 Negative values in /proc/latency_stats Corrado Zoccolo
2009-02-02 7:42 ` Harik
2009-02-03 4:55 ` Andrew Morton
2009-02-03 15:19 ` Arjan van de Ven [this message]
2009-02-04 0:16 ` Arjan van de Ven
2009-02-04 5:46 ` Andrew Morton
2009-02-04 5:55 ` Arjan van de Ven
2009-02-06 22:50 ` Corrado Zoccolo
2009-02-05 0:57 ` Tim Pepper
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=20090203071927.266e83a5@infradead.org \
--to=arjan@infradead.org \
--cc=akpm@linux-foundation.org \
--cc=czoccolo@gmail.com \
--cc=linux-kernel@vger.kernel.org \
/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