freebsd-dev/libexec/rtld-elf
Eric van Gyzen ddab052725 Disable SSE in libthr
Clang emits SSE instructions on amd64 in the common path of
pthread_mutex_unlock.  If the thread does not otherwise use SSE,
this usage incurs a context-switch of the FPU/SSE state, which
reduces the performance of multiple real-world applications by a
non-trivial amount (3-5% in one application).

Instead of this change, I experimented with eagerly switching the
FPU state at context-switch time.  This did not help.  Most of the
cost seems to be in the read/write of memory--as kib@ stated--and
not in the #NM handling.  I tested on machines with and without
XSAVEOPT.

One counter-argument to this change is that most applications already
use SIMD, and the number of applications and amount of SIMD usage
are only increasing.  This is absolutely true.  I agree that--in
general and in principle--this change is in the wrong direction.
However, there are applications that do not use enough SSE to offset
the extra context-switch cost.  SSE does not provide a clear benefit
in the current libthr code with the current compiler, but it does
provide a clear loss in some cases.  Therefore, disabling SSE in
libthr is a non-loss for most, and a gain for some.

I refrained from disabling SSE in libc--as was suggested--because
I can't make the above argument for libc.  It provides a wide variety
of code; each case should be analyzed separately.

https://lists.freebsd.org/pipermail/freebsd-current/2015-March/055193.html

Suggestions from:	dim, jmg, rpaulo
Approved by:	kib (mentor)
MFC after:	2 weeks
Sponsored by:	Dell Inc.
2015-08-05 12:53:55 +00:00
..
aarch64 Add on the addend when in the R_AARCH64_ABS64 and R_AARCH64_GLOB_DAT cases. 2015-07-05 11:42:01 +00:00
amd64 Disable SSE in libthr 2015-08-05 12:53:55 +00:00
arm IFUNC symbol type shall be processed for non-PLT relocations, 2014-08-29 09:29:10 +00:00
i386 Disable SSE in libthr 2015-08-05 12:53:55 +00:00
mips MIPS rtld: report missing symbol rather than segfaulting 2015-04-05 14:06:11 +00:00
powerpc Apply r246556 to powerpc: 2015-01-06 03:49:22 +00:00
powerpc64 IFUNC symbol type shall be processed for non-PLT relocations, 2014-08-29 09:29:10 +00:00
sparc64 IFUNC symbol type shall be processed for non-PLT relocations, 2014-08-29 09:29:10 +00:00
tests Fix "make checkdpadd" by "spoofing" DPADD 2014-08-26 09:01:11 +00:00
debug.c Rtld links with the specially built pic static libc library to get some 2011-08-24 20:05:13 +00:00
debug.h Remove historical GNUC test 2015-05-06 15:29:11 +00:00
libmap.c Always check the limits of array index variables before using them. 2014-08-21 02:40:33 +00:00
libmap.h Make the directory mapping functionality, which was previously only 2013-09-21 21:03:52 +00:00
Makefile Change compiler setting to make default visibility of the symbols for 2015-03-29 18:53:21 +00:00
Makefile.depend new depends 2015-06-16 23:37:19 +00:00
malloc.c Before calling mmap() on a shared library's text and data sections, rtld 2014-04-11 16:55:25 +00:00
map_object.c Before calling mmap() on a shared library's text and data sections, rtld 2014-04-11 16:55:25 +00:00
rtld_lock.c Change compiler setting to make default visibility of the symbols for 2015-03-29 18:53:21 +00:00
rtld_lock.h Change compiler setting to make default visibility of the symbols for 2015-03-29 18:53:21 +00:00
rtld_printf.c Add the LD_LIBRARY_PATH_FDS environmental variable. 2014-06-20 17:08:32 +00:00
rtld_printf.h Add the LD_LIBRARY_PATH_FDS environmental variable. 2014-06-20 17:08:32 +00:00
rtld_tls.h Change compiler setting to make default visibility of the symbols for 2015-03-29 18:53:21 +00:00
rtld.1 mdoc: remove superfluous paragraph macros. 2014-06-23 18:40:21 +00:00
rtld.c Remove historical GNUC test 2015-05-06 15:29:11 +00:00
rtld.h Implement support -z global linker option. It marks the shared object 2015-04-15 08:16:34 +00:00
Symbol.map Add rtld private interface for dso to detect dynamic loading 2015-01-03 18:09:53 +00:00
xmalloc.c Increase alignment to size of pointer if the alignment is too small. 2014-02-22 11:06:48 +00:00