[PATCH 2/2] libdw: Rewrite the memory handler to be more robust.

Jonathon Anderson jma14@rice.edu
Fri Nov 8 17:41:00 GMT 2019

On Fri, Nov 8, 2019 at 17:22, Mark Wielaard <mark@klomp.org> wrote:
> On Thu, 2019-11-07 at 12:40 -0600, Jonathon Anderson wrote:
>>  I haven't benchmarked this version, but I did benchmark the 
>> equivalent
>>  earlier version (this version is almost quite literally a rebase of 
>> the
>>  other). I don't have the exact results on hand, what I remember is 
>> that
>>  the pthread_key method was faster (and handled the many-thread case
>>  better), by maybe a factor of 1.5x-2x in parallel. In serial the
>>  overhead was minimal (just an extra pointer indirection on 
>> allocations).
> I just tested the single-threaded case a bit and is not measurable
> slower than the previous version, and compared to 0.177 things are
> maybe ~1% slower (so probably in the noise).
> A factor 1.5x-2.0x slower in parallel does seem significant. Is that 
> in
> the case of many-threads that are colliding a lot or in general?

I believe it was 64 threads colliding a lot (on the reader side of 
mem_rwl). That said, this is all based on my memory from before the 
semester started. (They may also be numbers munged out of a larger 
benchmark, so don't trust them too much).

As it happens, on our end any slowdown is entirely hidden by all the 
other work we do while reading DIEs, so its not a critical concern. Our 
code opens a Dwarf and then uses a #pragma parallel for across the CUs 
(using a serial recursion to read the DIEs), if you want to benchmark 
it that should suffice on a large enough example.

> Thanks,
> Mark

More information about the Elfutils-devel mailing list