freebsd-skq/share
vangyzen c03b18934d 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
..
colldef Add META_MODE support. 2015-06-13 19:20:56 +00:00
dict Add META_MODE support. 2015-06-13 19:20:56 +00:00
doc Readd merge.awk forgotten while importing the old vi documentation directly into 2015-06-20 00:13:28 +00:00
dtrace Add missing DTrace scripts that exist in the source tree to the Makefile for 2015-06-30 18:23:08 +00:00
examples Add missing shebang 2015-07-04 02:24:47 +00:00
i18n new depends 2015-06-16 23:37:19 +00:00
keys Remove scary comment about this being a test key. 2014-01-13 20:55:15 +00:00
man Add support for Planex GW-NS300N. 2015-08-04 15:04:28 +00:00
me Add META_MODE support. 2015-06-13 19:20:56 +00:00
misc - Add myself to the committers-ports.dot and add my mentor relationship. 2015-08-01 17:29:52 +00:00
mk Disable SSE in libthr 2015-08-05 12:53:55 +00:00
mklocale Add META_MODE support. 2015-06-13 19:20:56 +00:00
monetdef Add META_MODE support. 2015-06-13 19:20:56 +00:00
msgdef Add META_MODE support. 2015-06-13 19:20:56 +00:00
numericdef Add META_MODE support. 2015-06-13 19:20:56 +00:00
security Add META_MODE support. 2015-06-13 19:20:56 +00:00
sendmail Add META_MODE support. 2015-06-13 19:20:56 +00:00
skel Add META_MODE support. 2015-06-13 19:20:56 +00:00
snmp Add META_MODE support. 2015-06-13 19:20:56 +00:00
syscons Add META_MODE support. 2015-06-13 19:20:56 +00:00
tabset Add META_MODE support. 2015-06-13 19:20:56 +00:00
termcap Add META_MODE support. 2015-06-13 19:20:56 +00:00
tests
timedef Add META_MODE support. 2015-06-13 19:20:56 +00:00
vt kbdmap(1): Correct menu title: keyboards have a layout, not a language 2015-05-14 18:09:56 +00:00
zoneinfo Add META_MODE support. 2015-06-13 19:20:56 +00:00
Makefile Only build share/dtrace if MK_CDDL != no 2015-01-25 00:32:17 +00:00
Makefile.inc