From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 76393 invoked by alias); 25 Apr 2018 04:02:37 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 76084 invoked by uid 89); 25 Apr 2018 04:02:14 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 spammy=maxed X-HELO: smtp.707.technology Subject: Re: [PATCH v2 1/3] Tunables: Add tunables of spin count for pthread adaptive spin mutex To: Kemi Wang , Adhemerval Zanella , Glibc alpha Cc: Dave Hansen , Tim Chen , Andi Kleen , Ying Huang , Aaron Lu , Lu Aubrey References: <1524624988-29141-1-git-send-email-kemi.wang@intel.com> From: Rical Jasan Message-ID: <4be95d44-6f73-d6f8-c60b-6f7be7361ef4@2c3t.io> Date: Wed, 25 Apr 2018 04:02:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <1524624988-29141-1-git-send-email-kemi.wang@intel.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2018-04/txt/msg00505.txt.bz2 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