[PATCH V11] Mutex: Add pthread mutex tunables

H.J. Lu hjl.tools@gmail.com
Sat Dec 1 16:36:00 GMT 2018


On Fri, Nov 30, 2018 at 6:03 PM Carlos O'Donell <carlos@redhat.com> wrote:
>
> On 11/30/18 8:38 PM, Kemi Wang wrote:
> > ChangeLog:
> >     V10->V11:
> >       a) Fix comment style to use GNU style, and fixing indent in
> >       adaptive_spin_count.h.
> >       b) Update Changelog.
>
> This patch is basically done and you should check this into master.
>
> > diff --git a/ChangeLog b/ChangeLog
> > index 87d3863..773a7ec 100644
> > --- a/ChangeLog
> > +++ b/ChangeLog
> > @@ -1,3 +1,21 @@
>
> This needs a little cleanup.
>
> > +2018-12-1  Kemi Wang  <kemi.wang@intel.com>
> > +
> > +     * sysdeps/nptl/dl-tunables.list: Add glibc.pthread.mutex_spin_count entry.
> > +     * manual/tunables.texi: Add glibc.pthread.mutex_spin_count description.
> > +     * nptl/pthread_mutex_conf.h: New file.
> > +     * nptl/pthread_mutex_conf.c: New file.
> > +     * nptl/Makefile: Add pthread_mutex_conf.c for compilation.
> > +     * nptl/nptl-init.c: Put pthread mutex tunable initialization in pthread
> > +     initialization.
> > +     * nptl/pthreadP.h: Add a new function max_adaptive_count() to get the
> > +     maximum adaptive spin value.
> > +     * sysdeps/generic/adaptive_spin_count.h: Move DEFAULT_ADAPTIVE_COUNT
> > +     macro to a generic header.
> > +     * nptl/pthread_mutex_lock.c: Replace MAX_ADAPTIVE_COUNT by
> > +     max_adaptive_count().
> > +     * nptl/pthread_mutex_timedlock.c: Replace MAX_ADAPTIVE_COUNT by
> > +     max_adaptive_count().
>
> I suggest this:
>
> 2018-12-01  Kemi Wang  <kemi.wang@intel.com>
>
>         * manual/tunables.texi (POSIX Thread Tunables): New node.
>         * nptl/Makefile (libpthread-routines): Add pthread_mutex_conf.
>         * nptl/nptl-init.c: Include pthread_mutex_conf.h
>         (__pthread_initialize_minimal_internal) [HAVE_TUNABLES]: Call
>         pthread_tunables_init.
>         * nptl/pthreadP.h (MAX_ADAPTIVE_COUNT): Remove.
>         (max_adaptive_count): Define.
>         * nptl/pthread_mutex_conf.c: New file.
>         * nptl/pthread_mutex_conf.h: New file.
>         * sysdeps/generic/adaptive_spin_count.h: New file.
>         * sysdeps/nptl/dl-tunables.list: New file.
>         * nptl/pthread_mutex_lock.c (__pthread_mutex_lock): Use
>         max_adaptive_count () not MAX_ADAPTIVE_COUNT.
>         * nptl/pthread_mutex_timedlock.c (__pthrad_mutex_timedlock): Likewise.
>

This is the patch I am checking in for Kemi.  I renamed pthread_tunables_init
to __pthread_tunables_init and marked it hidden.


-- 
H.J.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Mutex-Add-pthread-mutex-tunables.patch
Type: text/x-patch
Size: 13829 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20181201/bfc7deaa/attachment.bin>


More information about the Libc-alpha mailing list