Re: [PATCH] lib + libdw: Add and use a concurrent version of the dynamic-size hash table.

2019-11-11 Thread Jonathon Anderson
On Mon, Nov 11, 2019 at 00:23, Mark Wielaard wrote: Hi Jonathon, On Fri, 2019-11-08 at 09:28 -0600, Jonathon Anderson wrote: > So to fix this we do need some mutex to protect the binary search > tree when calling tsearch/tfind? Or do you see other issues too? The search tree

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

2019-11-08 Thread Jonathon Anderson
On Fri, Nov 8, 2019 at 17:22, Mark Wielaard 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

Re: [PATCH] lib + libdw: Add and use a concurrent version of the dynamic-size hash table.

2019-11-08 Thread Jonathon Anderson
On Fri, Nov 8, 2019 at 15:07, Mark Wielaard wrote: Hi, On Thu, 2019-11-07 at 09:24 -0600, Jonathon Anderson wrote: On Thu, Nov 7, 2019 at 12:07, Mark Wielaard <mailto:m...@klomp.org>> wrote: > Looking at the difference between the previous version and this one, > it &g

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

2019-11-07 Thread Jonathon Anderson
On Thu, Nov 7, 2019 at 18:20, Mark Wielaard wrote: Hi Jonathan, On Tue, 2019-10-29 at 22:14 +0100, Mark Wielaard wrote: Pthread's thread-local variables are highly limited, which makes it difficult to use many Dwarfs. This replaces that with a less efficient (or elegant) but more robust

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

2019-11-07 Thread Jonathon Anderson
On Thu, Nov 7, 2019 at 18:20, Mark Wielaard wrote: Hi Jonathan, On Tue, 2019-10-29 at 22:14 +0100, Mark Wielaard wrote: Pthread's thread-local variables are highly limited, which makes it difficult to use many Dwarfs. This replaces that with a less efficient (or elegant) but more robust

Re: [PATCH] lib + libdw: Add and use a concurrent version of the dynamic-size hash table.

2019-11-07 Thread Jonathon Anderson
On Thu, Nov 7, 2019 at 12:07, Mark Wielaard wrote: Hi, On Mon, 2019-11-04 at 10:39 -0600, Jonathon Anderson wrote: Apologies, I talked with Srdan in person and forgot to relay the message. He gave me an updated version of the hash table that handles that issue (and another previously

[PATCH] lib + libdw: Add and use a concurrent version of the dynamic-size hash table.

2019-11-04 Thread Jonathon Anderson
From: Srđan Milaković Signed-off-by: Srđan Milaković --- Apologies for the delay, things have been busy here the past week. > On Fri, 2019-10-25 at 23:11 -0500, Jonathon Anderson wrote: > > I tried to simplify the code a little. You already observed that > > COMPARE can be zero

[PATCH] libdw: Don't free uninitialized Dwarf_Abbrev_Hash's of "fake" CUs.

2019-11-01 Thread Jonathon Anderson
so that these three are exempt from DAH and split-DWARF matters, and swaps the calloc for a malloc so Memcheck will catch any others. Signed-off-by: Jonathon Anderson --- > O! Sorry. I now see your original approach was actually correct. For > some reason I believed the fake cus could

[PATCH] libdw: Don't free uninitialized Dwarf_Abbrev_Hash's of "fake" CUs.

2019-10-31 Thread Jonathon Anderson
fake_{loc,loclists,addr}_cu are Dwarf_CUs that are created separate from all the others, so their contents are minimal and mostly initialized by a calloc. On dwarf_end however, they are freed through the same code path as all the others, so they call DAH_free like all the others. This changes that

[PATCH] libdw: Don't free uninitialized Dwarf_Abbrev_Hash's of "fake" CUs.

2019-10-30 Thread Jonathon Anderson
fake_{loc,loclists,addr}_cu are Dwarf_CUs that are created separate from all the others, so their contents are minimal and mostly initialized by a calloc. On dwarf_end however, they are freed through the same code path as all the others, so they call DAH_free like all the others. This changes that

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

2019-10-29 Thread Jonathon Anderson
hanged, 160 insertions(+), 53 deletions(-) On Tue, Oct 29, 2019 at 21:17, Mark Wielaard wrote: Hi Jonathon, On Tue, Oct 29, 2019 at 01:55:25PM -0500, Jonathon Anderson wrote: This is (revived and rebased) version of the libdw memory manager that isn't affected by the PTHREAD_KEYS_MAX

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

2019-10-29 Thread Jonathon Anderson
[PATCH 2/2] libdw: Rewrite the memory handler to be more robust. Pthread's thread-local variables are highly limited, which makes it difficult to use many Dwarfs. This replaces that with a less efficient (or elegant) but more robust method. Signed-off-by: Jonathon Anderson --- lib/atom

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

2019-10-29 Thread Jonathon Anderson
[PATCH 1/2] Add configure options for Valgrind annotations. Signed-off-by: Jonathon Anderson --- ChangeLog| 5 + configure.ac | 30 ++ 2 files changed, 35 insertions(+) diff --git a/ChangeLog b/ChangeLog index 911cf354..433a5f3c 100644 --- a/ChangeLog +++ b

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

2019-10-29 Thread Jonathon Anderson
about ~8N bytes of memory overhead. The first patch is not required and adds some configure-time options for Valgrind annotation support (although, I'm not a serious autotools user, so it might need some work). -Jonathon ---- Jonat

Re: [PATCH] libdw: add thread-safety to dwarf_getabbrev()

2019-10-28 Thread Jonathon Anderson
On Mon, Oct 28, 2019 at 14:26, Mark Wielaard wrote: On Sat, 2019-10-26 at 19:56 -0500, Jonathon Anderson wrote: On Sun, Oct 27, 2019 at 00:50, Mark Wielaard <mailto:m...@klomp.org>> wrote: > > I see that getconf PTHREAD_KEYS_MAX gives 1024 on my machine. > Is this

Re: [PATCH] libdw: add thread-safety to dwarf_getabbrev()

2019-10-27 Thread Jonathon Anderson
On Sun, Oct 27, 2019 at 09:59, Florian Weimer wrote: * Mark Wielaard: Current glibc versions have a thread-local fast path, which should address some of these concerns. It's still not a bump-pointer allocator, but at least there are no atomics on that path. Since which version of gli

Re: [PATCH 3/3] lib + libdw: Add and use a concurrent version of the dynamic-size hash table.

2019-10-27 Thread Jonathon Anderson
On Sun, Oct 27, 2019 at 17:13, Mark Wielaard wrote: On Fri, 2019-10-25 at 23:11 -0500, Jonathon Anderson wrote: On Sat, Oct 26, 2019 at 01:50, Mark Wielaard <mailto:m...@klomp.org>> wrote: > For example I am not sure I can proof that in resize_worker() this > alway

Re: [PATCH] libdw: add thread-safety to dwarf_getabbrev()

2019-10-26 Thread Jonathon Anderson
On Sun, Oct 27, 2019 at 00:50, Mark Wielaard wrote: Hi, On Sat, 2019-10-26 at 11:45 -0500, Jonathon Anderson wrote: For some overall perspective, this patch replaces the original libdw allocator with a thread-safe variant. The original acts both as a suballocator (to keep from paying

Re: [PATCH] libdw: add thread-safety to dwarf_getabbrev()

2019-10-26 Thread Jonathon Anderson
Hello Florian Weimer, I'm the original author of this patch, so I'll try to answer what I can. For some overall perspective, this patch replaces the original libdw allocator with a thread-safe variant. The original acts both as a suballocator (to keep from paying the malloc tax on frequent sma

Re: [PATCH 3/3] lib + libdw: Add and use a concurrent version of the dynamic-size hash table.

2019-10-25 Thread Jonathon Anderson
On Sat, Oct 26, 2019 at 01:50, Mark Wielaard wrote: Hi, Sorry this took so long to review. But it is pretty complex code. I think I got how it works mostly. It is hard to proof correct though. How did you convince yourself that the code is correct? No worries, its a complex piece of code.

Re: [PATCH 2/3] libdw: Rewrite the memory handler to be thread-safe.

2019-10-21 Thread Jonathon Anderson
On Mon, Oct 21, 2019 at 18:13, Mark Wielaard wrote: Hi, Finally back to this patch series. On Thu, 2019-08-29 at 15:16 +0200, Mark Wielaard wrote: diff --git a/libdw/dwarf_end.c b/libdw/dwarf_end.c index 29795c10..fc573cb3 100644 --- a/libdw/dwarf_end.c +++ b/libdw/dwarf_end.c @@ -94,

Re: [PATCH] libdw: add thread-safety to dwarf_getabbrev()

2019-08-26 Thread Jonathon Anderson
22:29:45 -0500) ---- Jonathon Anderson (2): Add some supporting framework for C11-style atomics. libdw: Rewrite the memory handler to be thread-safe. Srđan Milaković (1): lib + libdw: Add and use a concurrent version of the dynamic-size hash table.

Re: [PATCH] libdw: add thread-safety to dwarf_getabbrev()

2019-08-26 Thread Jonathon Anderson
Glad I could be of help testing the mailinglist :) -Jonathon On Mon, Aug 26, 2019 at 8:18 AM, Mark Wielaard wrote: Hi Jonathon, Thanks for checking our new mailinglist settings :) You message was accepted now and the HTML attachment stripped. On Sun, 2019-08-25 at 20:24 -0500, Jonathon Ander

Re: [PATCH] libdw: add thread-safety to dwarf_getabbrev()

2019-08-25 Thread Jonathon Anderson
h table. (2019-08-25 18:36:38 -0500) ---- Jonathon Anderson (3): Add configure options for Valgrind annotations. Add some supporting framework for C11-style atomics. libdw: Rewrite the memory handler to be thread-safe. Srđan Milaković (1): lib + libdw: Add and use a concurrent vers

Re: [PATCH] libdw: add thread-safety to dwarf_getabbrev()

2019-08-24 Thread Jonathon Anderson
On Sat, Aug 24, 2019 at 6:24 PM, Mark Wielaard wrote: Hi, On Fri, Aug 16, 2019 at 02:24:28PM -0500, Jonathon Anderson wrote: 2. Adding a lock & array structure to the memory manager (pseudo-TLS) (libdwP.h, libdw_alloc.c) Specifically concentrating on this part. diff --git a/l

Re: [PATCH] libdw: add thread-safety to dwarf_getabbrev()

2019-08-23 Thread Jonathon Anderson
On Fri, Aug 23, 2019 at 1:25 PM, Mark Wielaard wrote: Hi, On Wed, 2019-08-21 at 09:08 -0500, Jonathon Anderson wrote: On Wed, Aug 21, 2019 at 6:16 AM, Mark Wielaard wrote:On Fri, 2019-08-16 at 14:24 -0500, Jonathon Anderson wrote: > > For parallel applications that ne

Re: [PATCH] libdw: add thread-safety to dwarf_getabbrev()

2019-08-21 Thread Jonathon Anderson
On Wed, Aug 21, 2019 at 4:50 PM, Mark Wielaard wrote: On Fri, 2019-08-16 at 14:24 -0500, Jonathon Anderson wrote: diff --git a/ChangeLog b/ChangeLog index bed3999f..93907ddd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2019-08-15 Jonathon Anderson + + * configure.ac

Re: [PATCH] libdw: add thread-safety to dwarf_getabbrev()

2019-08-21 Thread Jonathon Anderson
First message failed to send, hopefully this one works... On Wed, Aug 21, 2019 at 6:16 AM, Mark Wielaard wrote: Hi Jonathon and Srđan, On Fri, 2019-08-16 at 14:24 -0500, Jonathon Anderson wrote: For parallel applications that need the information in the DIEs, the Dwarf_Abbrev hash table et

[PATCH] libdw: add thread-safety to dwarf_getabbrev()

2019-08-16 Thread Jonathon Anderson
cture to the memory manager (pseudo-TLS) (libdwP.h, libdw_alloc.c) 3. Adding extra configure options for Helgrind/DRD annotations (configure.ac) 4. Including "stdatomic.h" from FreeBSD, to support C11-style atomics. (lib/stdatomic.h) Signed-off-by: Jonathon Anderson Signed-off-b