Re: [patch] Latency Tracer, voluntary-preempt-2.6.8-rc4-O6

From: Paulo Marques
Date: Sat Aug 14 2004 - 08:57:52 EST


Ingo Molnar wrote:
* Paulo Marques <pmarques@xxxxxxxxxxxx> wrote:


yeah. Maybe someone will find the time to improve the algorithm. But
it's not a highprio thing.

Well, I found some time and decided to give it a go :)


great, your patch is looking really good!

Thanks :)


The original algorithm took, on average, 1340us per lookup on my P4
2.8GHz. The compile settings for the test are not the same on the
kernel, so this can be only compared against other results from the
same setup.


ouch. I consider fixing this a quality of implementation issue.


With the attached patch it takes 14us per lookup. This is almost a
100x improvement.


wow! I have tried your patch and /proc/latency_trace now produces
instantaneous output.

Good to ear

...

your patch doesnt add all that much of code. It adds 288 bytes to .text
and 64 bytes to .data. A typical .config generates 180K of compressed
kallsyms data (with !KALLSYMS_ALL), so your patch increases the kallsyms
overhead by a mere 0.2%. So it's really not an issue - especially since
kallsyms can be disabled in .config.

The 64 bytes of data can be further tuned using the KALLSYMS_STEM_MARKS define.

Setting it to 16 instead of 8 will speed up the algorithm by _almost_ twice the speed. As the number grows higher, the speed up is less noticeable.

...

the standard way is to add the extra initializers. The gcc folks feel
that those rare cases where gcc gets it wrong justify the benefit of
catching lots of real bugs. I've added the extra initialization to -O8.

Ok, now that I know how it should be done, next time I'll add them myself :)

--
Paulo Marques - www.grupopie.com
"In a world without walls and fences who needs windows and gates?"
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/