Go to file
Kemi Wang 6310e6be9b Mutex: Add pthread mutex tunables
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 32767 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.

I would extend my appreciation sincerely to H.J.Lu for his help to refine
this patch series.

	* 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.

Suggested-by: Andi Kleen <andi.kleen@intel.com>
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Signed-off-by: Kemi.wang <kemi.wang@intel.com>
2018-12-01 08:19:20 -08:00
argp argp: do not call _IO_fwide() if _LIBC is not defined 2018-11-29 17:56:55 +00:00
assert
benchtests
bits
catgets
ChangeLog.old
conform Combine more conformtest tests into single execution of the compiler. 2018-11-22 21:21:36 +00:00
crypt
csu
ctype
debug
dirent
dlfcn malloc: tcache double free check 2018-11-20 13:24:09 -05:00
elf Fix _dl_profile_fixup data-dependency issue (Bug 23690) 2018-11-30 18:05:32 -02:00
gmon
gnulib
grp
gshadow
hesiod
htl
hurd hurd: Fix spawni's user_link reallocation 2018-11-11 20:09:17 +01:00
iconv
iconvdata
include Fix _dl_profile_fixup data-dependency issue (Bug 23690) 2018-11-30 18:05:32 -02:00
inet
intl
io
libio posix: Use posix_spawn on popen 2018-11-30 18:42:05 -02:00
locale
localedata
login
mach
malloc malloc: tcache: Validate tc_idx before checking for double-frees [BZ #23907] 2018-11-26 20:06:37 +01:00
manual Mutex: Add pthread mutex tunables 2018-12-01 08:19:20 -08:00
math Remove the error handling wrapper from pow 2018-11-21 09:58:36 +00:00
mathvec
misc Add support for GCC 9 attribute copy. 2018-11-09 17:24:12 -07:00
nis
nptl Mutex: Add pthread mutex tunables 2018-12-01 08:19:20 -08:00
nptl_db
nscd
nss
po
posix posix: Do not include testcases.h, ptestcases.h in source tree 2018-11-29 13:51:25 +01:00
pwd
resolv Add an additional test to resolv/tst-resolv-network.c 2018-11-08 13:47:34 +01:00
resource
rt
scripts scripts/abilist.awk: Handle special _end symbol for Hurd 2018-11-30 22:22:57 +01:00
setjmp
shadow
signal
socket
soft-fp
stdio-common
stdlib stdlib: assert on NULL function pointer in atexit etc. [BZ #20544] 2018-11-30 16:18:34 -08:00
streams
string
sunrpc
support support: Add signal support to support_capture_subprocess_check 2018-11-28 20:57:18 +01:00
sysdeps Mutex: Add pthread mutex tunables 2018-12-01 08:19:20 -08:00
sysvipc
termios
time mktime: DEBUG_MKTIME cleanup 2018-11-15 22:59:33 +01:00
timezone
wcsmbs
wctype
.gitattributes
.gitignore
abi-tags
aclocal.m4
ChangeLog Mutex: Add pthread mutex tunables 2018-12-01 08:19:20 -08:00
config.h.in
config.make.in
configure
configure.ac
COPYING
COPYING.LIB
extra-lib.mk
gen-locales.mk
INSTALL
libc-abis
libof-iterator.mk
LICENSES
MAINTAINERS
Makeconfig
Makefile
Makefile.in
Makerules Replace gen-as-const.awk by gen-as-const.py. 2018-11-30 15:20:41 +00:00
NEWS posix: Use posix_spawn on popen 2018-11-30 18:42:05 -02:00
o-iterator.mk
README
Rules
shlib-versions
test-skeleton.c
version.h

This directory contains the sources of the GNU C Library.
See the file "version.h" for what release version you have.

The GNU C Library is the standard system C library for all GNU systems,
and is an important part of what makes up a GNU system.  It provides the
system API for all programs written in C and C-compatible languages such
as C++ and Objective C; the runtime facilities of other programming
languages use the C library to access the underlying operating system.

In GNU/Linux systems, the C library works with the Linux kernel to
implement the operating system behavior seen by user applications.
In GNU/Hurd systems, it works with a microkernel and Hurd servers.

The GNU C Library implements much of the POSIX.1 functionality in the
GNU/Hurd system, using configurations i[4567]86-*-gnu.

When working with Linux kernels, this version of the GNU C Library
requires Linux kernel version 3.2 or later.

Also note that the shared version of the libgcc_s library must be
installed for the pthread library to work correctly.

The GNU C Library supports these configurations for using Linux kernels:

	aarch64*-*-linux-gnu
	alpha*-*-linux-gnu
	arm-*-linux-gnueabi
	hppa-*-linux-gnu
	i[4567]86-*-linux-gnu
	x86_64-*-linux-gnu	Can build either x86_64 or x32
	ia64-*-linux-gnu
	m68k-*-linux-gnu
	microblaze*-*-linux-gnu
	mips-*-linux-gnu
	mips64-*-linux-gnu
	powerpc-*-linux-gnu	Hardware or software floating point, BE only.
	powerpc64*-*-linux-gnu	Big-endian and little-endian.
	s390-*-linux-gnu
	s390x-*-linux-gnu
	riscv64-*-linux-gnu
	sh[34]-*-linux-gnu
	sparc*-*-linux-gnu
	sparc64*-*-linux-gnu

If you are interested in doing a port, please contact the glibc
maintainers; see http://www.gnu.org/software/libc/ for more
information.

See the file INSTALL to find out how to configure, build, and install
the GNU C Library.  You might also consider reading the WWW pages for
the C library at http://www.gnu.org/software/libc/.

The GNU C Library is (almost) completely documented by the Texinfo manual
found in the `manual/' subdirectory.  The manual is still being updated
and contains some known errors and omissions; we regret that we do not
have the resources to work on the manual as much as we would like.  For
corrections to the manual, please file a bug in the `manual' component,
following the bug-reporting instructions below.  Please be sure to check
the manual in the current development sources to see if your problem has
already been corrected.

Please see http://www.gnu.org/software/libc/bugs.html for bug reporting
information.  We are now using the Bugzilla system to track all bug reports.
This web page gives detailed information on how to report bugs properly.

The GNU C Library is free software.  See the file COPYING.LIB for copying
conditions, and LICENSES for notices about a few contributions that require
these additional notices to be distributed.  License copyright years may be
listed using range notation, e.g., 1996-2015, indicating that every year in
the range, inclusive, is a copyrightable year that would otherwise be listed
individually.