This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [trans-mem] Add futex-based serial lock


On Sat, Aug 20, 2011 at 8:51 AM, Torvald Riegel <triegel@redhat.com> wrote:
> This adds a futex-based version of the serial lock for use on Linux. The
> futex code is basically old code of libitm (it got removed in SVN rev
> 157758) with one fix for sysfutex0 on x86_64 and one change that returns
> the number of woken processes (futex_wake).
>
> The gtm_rwlock is similar in concept to the mutex-based version, but
> adapted to futexes. It performs better than the mutex-based version. Not
> really great yet, but there is no spinning yet, so on contention we'll
> always have the overhead of waiting via the futexes.
>
> Again, RBTree with 1/2/4/6 threads, with different update %:
> ?0%: ?49 ? ?89 ? 120 ? 120
> ?1%: ?48 ? ?65 ? ?75 ? ?80
> ?20%: ?35 ? ?10 ? ?10 ? ? 9
> 100%: ?16.5 ? 2.5 ? 2.5 ? 2.5
>
> For comparison, the mutex-based version:
> 0%: ? ?49 / 90 / 120
> 1%: ? ?47 / 59 / ?27
> 20% ? ?34 / ?6 / ? 3
> 100%: ?15 / ?1 / ? 1
>
> OK for branch?
>

For x86. please use

#ifdef __x86_64__
# ifndef SYS_futex
#  define SYS_futex	202
# endif

so that it works with x32. See libgomp/config/linux/x86/futex.h

Thanks.

-- 
H.J.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]