This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH v2 1/3] Tunables: Add tunables of spin count for pthread adaptive spin mutex
- From: kemi <kemi dot wang at intel dot com>
- To: Rical Jasan <rj at 2c3t dot io>, Adhemerval Zanella <adhemerval dot zanella at linaro dot org>, Glibc alpha <libc-alpha at sourceware dot org>
- Cc: Dave Hansen <dave dot hansen at linux dot intel dot com>, Tim Chen <tim dot c dot chen at intel dot com>, Andi Kleen <andi dot kleen at intel dot com>, Ying Huang <ying dot huang at intel dot com>, Aaron Lu <aaron dot lu at intel dot com>, Lu Aubrey <aubrey dot li at intel dot com>
- Date: Wed, 25 Apr 2018 13:11:52 +0800
- Subject: Re: [PATCH v2 1/3] Tunables: Add tunables of spin count for pthread adaptive spin mutex
- References: <1524624988-29141-1-git-send-email-kemi.wang@intel.com> <4be95d44-6f73-d6f8-c60b-6f7be7361ef4@2c3t.io>
Hi, Rical
Thanks for your help to polish this description.
That's much better than before, I will fold these changes in the next version.
On 2018年04月25日 12:02, Rical Jasan wrote:
> On 04/24/2018 07:56 PM, Kemi Wang wrote:
> ...
>> diff --git a/manual/tunables.texi b/manual/tunables.texi
>> index be33c9f..c2cf8c6 100644
>> --- a/manual/tunables.texi
>> +++ b/manual/tunables.texi
>> @@ -281,6 +281,27 @@ of try lock attempts.
>> The default value of this tunable is @samp{3}.
>> @end deftp
>>
>> +@node Pthread Mutex Tunables
>> +@section Pthread Mutex Tunables
>> +@cindex pthread mutex tunables
>> +
>> +@deftp {Tunable namespace} glibc.mutex
>> +Behavior of pthread mutex can be tuned to gain performance improvement
>> +according to specific hardware capability and workload character by setting
>> +the following tunables in the @code{mutex} namespace.
>
> The behavior of pthread mutexes can be tuned to gain performance
> improvements according to specific hardware capabilities and workload
> characteristics by setting the following tunables in the @code{mutex}
> namespace:
>
OK.
>> +@end deftp
>> +
>> +@deftp Tunable glibc.mutex.spin_count
>> +The @code{glibc.mutex.spin_count} tunable sets the maximum spin times that
>> +a thread should spin on the lock before calling into the kernel to block.
>
> "maximum number of times a thread should spin"
>
OK
>> +Adaptive spin is used for the mutex initialized with PTHREAD_MUTEX_ADAPTIVE_NP
>
> "used for mutexes initialized with the"
>
>> +GNU extension. It affects both pthread_mutex_lock and pthread_mutex_timedlock.
>
> Double spaces between sentences.
>
Sure.
>> +The spinning is done in case of either the maximum spin times is reached or
>> +the lock is acquired during spinning.
>
> Why would we spin after we've maxed out spinning (or acquired the lock)?
> Perhaps this should read:
>
> "Spinning is done until either the maximum spin count is reached or the
> lock is acquired."
>
more readable, thanks.
>> +
>> +The default value of this tunable is @samp{1000}.
>> +@end deftp
>> +
>> @node Hardware Capability Tunables
>> @section Hardware Capability Tunables
>> @cindex hardware capability tunables
>
> Rical
>