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: Rical Jasan <rj at 2c3t dot io>
- To: Kemi Wang <kemi dot wang at intel dot com>, 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: Tue, 24 Apr 2018 21:02:07 -0700
- 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>
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:
> +@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"
> +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.
> +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."
> +
> +The default value of this tunable is @samp{1000}.
> +@end deftp
> +
> @node Hardware Capability Tunables
> @section Hardware Capability Tunables
> @cindex hardware capability tunables
Rical