https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71744

--- Comment #26 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
(In reply to Gleb Natapov from comment #25)
> Using Torvald's rwlock would be definitely better that current state, but
> not as good as per thread lock.

In theory there could be e.g. an option to keep using the recursive lock by
default and if e.g. dl_iterate_phdr determines it has been called already many
times, or detects contention some way, it could under that allocate the page
with the locks and switch to using that from that point on or something
similar.
Or start with rwlock and switch to array of locks, whatever.

I'm not a glibc developer anymore, so I'll leave it to its maintainers, just
wanted to express my fears.

> I think I misunderstood what you propose. My patch essentially does what you
> suggest already, it calls the function dl_iterate_phdr_parallel instead of
> dl_iterate_phdr_rd, but otherwise it is the same: it can run multiple
> callback in parallel, so we only disagree on how _parallel_ part is achieved
> internally.
> On glibc list there were some concerns about widening the interface though.
> They may prefer to use symbol versioning to change dl_iterate_phdr semantics
> (not sure if and how this can be done yet).

Using symbol versioning to change the number of arguments of a function IMHO is
just wrong, using a different name is cleaner, and dl_iterate_phdr isn't used
these days just in glibc where I've originally added it (for the use in the
unwinder), but various other OSes, some BSDs, Solaris, ..., and not sure if all
of them use symbol versioning, especially the GNU one.

Reply via email to