This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH v8] Mutex: Add pthread mutex tunables
- From: kemi <kemi dot wang at intel dot com>
- To: Adhemerval Zanella <adhemerval dot zanella at linaro dot org>, Florian Weimer <fweimer at redhat dot com>, Rical Jason <rj at 2c3t dot io>, Carlos Donell <carlos at redhat dot com>, 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: Mon, 16 Jul 2018 08:44:46 +0800
- Subject: Re: [PATCH v8] Mutex: Add pthread mutex tunables
- References: <1531185457-28752-1-git-send-email-kemi.wang@intel.com>
On 2018年07月10日 09:17, Kemi Wang wrote:
> This patch does not have any functionality change, we only provide a spin
> count tunes for pthread adaptive spin mutex. The tunable
> glibc.pthread.mutex_spin_count tunes can be used by system administrator to
> squeeze system performance according to different hardware capabilities and
> workload characteristics.
>
> The maximum value of spin count is limited to 30000 to avoid the overflow
> of mutex->__data.__spins variable with the possible type of short in
> pthread_mutex_lock ().
>
> The default value of spin count is set to 100 with the reference to the
> previous number of times of spinning via trylock. This value would be
> architecture-specific and can be tuned with kinds of benchmarks to fit most
> cases in future.
>
> * sysdeps/nptl/dl-tunables.list: Add glibc.pthread.mutex_spin_count entry.
> * manual/tunables.texi: Add glibc.pthread.mutex_spin_count description.
> * sysdeps/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: Move MAX_ADAPTIVE_COUNT macro definition to
> pthread_mutex_conf.h
>
> I would extend my appreciation sincerely to H.J.Lu for his help to refine
> this patch series.
>
> ChangeLog:
> V7->V8:
> a) Refine the pthread tunables description in manual/tunables.texi
> accordingly to Carlos O'Donell and Rical Jason.
>
> V6->V7:
> a) Patch is refined by H.J.Lu
>
> V5->V6:
> a) Missing "pthread mutex tunables" entry in the menu of tunables.texi,
> add it.
>
> V4->V5
> a) Put mutex tunable (glibc.mutex.spin_count) initialization as part of
> overall pthread initialization, that would avoid the extra relocation,
> as suggested by Florian Weimer. Thanks for pointing it out!
> b) Move the READ_ONLY_SPIN macro definition from the third patch to
> this patch
>
> V3->V4
> a) Add comments in elf/dl-tunables.list
>
> V2->V3
> a) Polish the description of glibc.mutex.spin_count tunable with the
> help from Rical Jasan.
> b) Get rid of the TUNABLE_CALLBACK_FNDECL macros in
> pthread_mutex_conf.c, as suggested by Florian Weimer.
> c) Adjust the default value of spin count to 100 with the reference of
> the previous spinning way via trylock.
>
> V1->V2
> a) Renamed nptl/mutex-conf.h -> nptl/pthread_mutex_conf.h
> b) Renamed nptl/mutex-conf.c -> nptl/pthread_mutex_conf.c
> c) Change the Makefile to compile pthread_mutex_conf.c
> d) Modify the copyright "2013-2018" -> "2018" for new added files
> e) Fix the indentation issue (tab -> double space) in
> elf/dl-tunables.list
> f) Remove the env alias LD_SPIN_COUNT in elf/dl-tunables.list
> g) Fix the typo errors and refresh glibc.mutex.spin_count tunable
> description in manual/tunables.texi.
> h) Fix the indentation issue in nptl/pthread_mutex_conf.c
> i) Fix the indentation issue for nested preprocessor (add one space for
> each level)
>
> Reviewed-by: Carlos O'Donell <carlos@redhat.com>
> Suggested-by: Andi Kleen <andi.kleen@intel.com>
> Signed-off-by: Kemi.wang <kemi.wang@intel.com>
> ---
PING
Anything else I need to do for this patch?