From: Gleb Natapov <gleb@scylladb.com>
To: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Cc: Florian Weimer <fweimer@redhat.com>,
Torvald Riegel <triegel@redhat.com>,
libc-alpha@sourceware.org
Subject: Re: [PATCH RFC] introduce dl_iterate_phdr_parallel
Date: Wed, 03 Aug 2016 14:31:00 -0000 [thread overview]
Message-ID: <20160803143048.GI551@scylladb.com> (raw)
In-Reply-To: <4b2a858b-18f7-cb61-3e43-51f6b783db24@linaro.org>
On Wed, Aug 03, 2016 at 11:00:39AM -0300, Adhemerval Zanella wrote:
>
>
> On 03/08/2016 07:53, Florian Weimer wrote:
> > On 08/01/2016 09:46 PM, Torvald Riegel wrote:
> >> The new rwlock is built so that it supports process-shared usage, which
> >> means that we have to put everything into struct pthread_rwlock_t. This
> >> will lead to contention if you rdlock it frequently from many threads.
> >> There is potential for tuning there because we haven't looked closely at
> >> adding back-off in the CAS loop (and if you tested on an arch without
> >> direct HW support for fetch-add, the CAS loop used instead of that might
> >> also be suboptimal).
> >
> > The rwlock doesn't eliminate the contention at the hardware level.
> >
> > If that causes a performance issue, we could reuse Ingo Molnar's brlock approach: per-thread, readers acquire their own lock, writers acquire the locks of all threads. This is fairly efficient in the read case (and I suspect you can't get much better than that in a non-managed run tine), but the write case is obviously extremely costly. This could be the right trade-off here, though.
> >
> > Florian
>
> The only difference is lglocks/brlocks are per-cpu in kernel, not per-thread.
I proposed the same algorithm that Florian describes somewhere in this
thread as an alternative too. Linux kernel does similar trick in mmu
notifiers code (search for mm_take_all_locks), but I wouldn't go this
more complicated route until it is proven that current version has
scalability problems.
> My concern is what kind of writer degradation it could be in a highly threaded
> workload (for instance, a threaded c++ workload with some exceptions that tries
> to load a plugin).
>
The forward progress of plugin loader is guarantied.
> It could be the case a constant write lock array, as the initial proposal, could
> be a better initial proposal.
Agree 100%.
--
Gleb.
next prev parent reply other threads:[~2016-08-03 14:31 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-25 14:44 Gleb Natapov
2016-07-28 21:57 ` Adhemerval Zanella
2016-07-31 13:51 ` Gleb Natapov
2016-08-01 18:06 ` Adhemerval Zanella
2016-08-01 18:50 ` Gleb Natapov
2016-08-01 19:46 ` Torvald Riegel
2016-08-01 20:07 ` Gleb Natapov
2016-08-01 20:20 ` Torvald Riegel
2016-08-01 20:42 ` Gleb Natapov
2016-08-03 17:26 ` Torvald Riegel
2016-08-03 17:47 ` Gleb Natapov
2016-08-04 17:17 ` Torvald Riegel
2016-08-04 17:37 ` Gleb Natapov
2016-08-04 17:58 ` Torvald Riegel
2016-08-04 18:28 ` Gleb Natapov
2016-08-03 10:54 ` Florian Weimer
2016-08-03 14:00 ` Adhemerval Zanella
2016-08-03 14:31 ` Gleb Natapov [this message]
2016-08-03 16:12 ` Torvald Riegel
2016-08-01 20:24 ` Adhemerval Zanella
2016-08-02 10:47 ` Gleb Natapov
2016-08-02 14:16 ` Adhemerval Zanella
2016-08-02 14:55 ` Gleb Natapov
2016-08-02 15:31 ` Gleb Natapov
2016-08-01 20:26 ` Carlos O'Donell
2016-08-01 20:52 ` Gleb Natapov
2016-08-01 20:58 ` Carlos O'Donell
2016-08-02 6:46 ` Gleb Natapov
2016-08-02 9:56 ` Gleb Natapov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160803143048.GI551@scylladb.com \
--to=gleb@scylladb.com \
--cc=adhemerval.zanella@linaro.org \
--cc=fweimer@redhat.com \
--cc=libc-alpha@sourceware.org \
--cc=triegel@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).