https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71744
Florian Weimer <fw at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |RESOLVED Resolution|--- |FIXED --- Comment #32 from Florian Weimer <fw at gcc dot gnu.org> --- Fixed via r12-6210-g790854ea7670f1 for dynamically linked code: commit 790854ea7670f11c14d431c102a49181d2915965 Author: Florian Weimer <fwei...@redhat.com> Date: Tue Jan 4 15:47:30 2022 +0100 libgcc: Use _dl_find_object in _Unwind_Find_FDE libgcc/ChangeLog: * unwind-dw2-fde-dip.c (_Unwind_Find_FDE): Call _dl_find_object if available. And r13-2706-g6e80a1d164d1f9 for the run-time code registration interface: commit 6e80a1d164d1f996ad08a512c000025a7c2ca893 Author: Thomas Neumann <tneum...@users.sourceforge.net> Date: Tue Mar 1 21:57:35 2022 +0100 eliminate mutex in fast path of __register_frame The __register_frame/__deregister_frame functions are used to register unwinding frames from JITed code in a sorted list. That list itself is protected by object_mutex, which leads to terrible performance in multi-threaded code and is somewhat expensive even if single-threaded. There was already a fast-path that avoided taking the mutex if no frame was registered at all. This commit eliminates both the mutex and the sorted list from the atomic fast path, and replaces it with a btree that uses optimistic lock coupling during lookup. This allows for fully parallel unwinding and is essential to scale exception handling to large core counts. libgcc/ChangeLog: * unwind-dw2-fde.c (release_registered_frames): Cleanup at shutdown. (__register_frame_info_table_bases): Use btree in atomic fast path. (__deregister_frame_info_bases): Likewise. (_Unwind_Find_FDE): Likewise. (base_from_object): Make parameter const. (classify_object_over_fdes): Add query-only mode. (get_pc_range): Compute PC range for lookup. * unwind-dw2-fde.h (last_fde): Make parameter const. * unwind-dw2-btree.h: New file.