[PATCH v2 1/3] Tunables: Add tunables of spin count for pthread adaptive spin mutex
Rical Jasan
rj@2c3t.io
Wed Apr 25 04:02:00 GMT 2018
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
More information about the Libc-alpha
mailing list