[PATCH v7 1/2] Mutex: Add pthread mutex tunables
Rical Jasan
rj@2c3t.io
Fri Jul 6 22:48:00 GMT 2018
On 07/06/2018 10:53 AM, Carlos O'Donell wrote:
> On 07/06/2018 03:50 AM, Kemi Wang wrote:
...
>> diff --git a/manual/tunables.texi b/manual/tunables.texi
>> index be33c9f..8cdfde1 100644
>> --- a/manual/tunables.texi
>> +++ b/manual/tunables.texi
>> @@ -32,6 +32,7 @@ their own namespace.
>> * Tunable names:: The structure of a tunable name
>> * Memory Allocation Tunables:: Tunables in the memory allocation subsystem
>> * Elision Tunables:: Tunables in elision subsystem
>> +* Pthread Mutex Tunables:: Tunables in pthread subsystem
>
> POSIX Thread Tunables:: Tunables in the POSIX thread subsystem
Good.
>> * Hardware Capability Tunables:: Tunables that modify the hardware
>> capabilities seen by @theglibc{}
>> @end menu
>> @@ -281,6 +282,28 @@ of try lock attempts.
>> The default value of this tunable is @samp{3}.
>> @end deftp
>>
>> +@node Pthread Mutex Tunables
>
> POSIX Thread Tunables
Good.
>> +@section Pthread Mutex Tunables
>
> Mutex Tunables
Why call the node POSIX Thread Tunables but the section Mutex Tunables?
>> +@cindex pthread mutex tunables
>
> thread mutex tunables
I have no objection to loading up the Concept Index. It's meant for
second-guessing your audience; e.g.:
@cindex pthread mutex tunables
@cindex thread mutex tunables
@cindex mutex tunables
@cindex tunables thread mutex
>> +
>> +@deftp {Tunable namespace} glibc.pthread
>> +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{pthread} namespace:
>
> The behavior of POSIX threads can be tuned to gain performance improvements
> according to specific hardware capabilities and workload characteristics by
> setting the following tunables in the @code{pthread} namespace:
Good.
>> +@end deftp
>> +
>> +@deftp Tunable glibc.pthread.mutex_spin_count
>> +The @code{glibc.pthread.mutex_spin_count} tunable sets the maximum number of times
>> +a thread should spin on the lock before calling into the kernel to block.
>> +Adaptive spin is used for mutexes initialized with the PTHREAD_MUTEX_ADAPTIVE_NP
>> +GNU extension. It affects both pthread_mutex_lock and pthread_mutex_timedlock.
>> +
>> +The spinning is done until either the maximum spin times is reached or
>> +the lock is acquired.
>> +
>> +The default value of this tunable is @samp{100}.
>> +@end deftp
>> +
>
> OK.
I think PTHREAD_MUTEX_ADAPTIVE_NP and pthread_mutex_(timed)?lock should
be in @code.
Also, "the maximum spin count is reached".
>> @node Hardware Capability Tunables
>> @section Hardware Capability Tunables
>> @cindex hardware capability tunables
Rical
More information about the Libc-alpha
mailing list