This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH v7 1/2] Mutex: Add pthread mutex tunables
- From: Rical Jasan <rj at 2c3t dot io>
- To: Carlos O'Donell <carlos at redhat dot com>, Kemi Wang <kemi dot wang at intel dot com>
- Cc: Adhemerval Zanella <adhemerval dot zanella at linaro dot org>, Florian Weimer <fweimer at redhat dot com>, Glibc alpha <libc-alpha at sourceware dot org>, 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: Fri, 6 Jul 2018 15:47:53 -0700
- Subject: Re: [PATCH v7 1/2] Mutex: Add pthread mutex tunables
- References: <1530863409-326-1-git-send-email-kemi.wang@intel.com> <d9459789-805d-3950-e729-a30cbe2eb849@redhat.com>
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