freebsd-skq/sys
mjg 91ae39e258 mtx: move lockstat handling out of inline primitives
Lockstat requires checking if it is enabled and if so, calling a 6 argument
function. Further, determining whether to call it on unlock requires
pre-reading the lock value.

This is problematic in at least 3 ways:
- more branches in the hot path than necessary
- additional cacheline ping pong under contention
- bigger code

Instead, check first if lockstat handling is necessary and if so, just fall
back to regular locking routines. For this purpose a new macro is introduced
(LOCKSTAT_PROFILE_ENABLED).

LOCK_PROFILING uninlines all primitives. Fold in the current inline lock
variant into the _mtx_lock_flags to retain the support. With this change
the inline variants are not used when LOCK_PROFILING is defined and thus
can ignore its existence.

This results in:
   text	   data	    bss	    dec	    hex	filename
22259667	1303208	4994976	28557851	1b3c21b	kernel.orig
21797315	1303208	4994976	28095499	1acb40b	kernel.patched

i.e. about 3% reduction in text size.

A remaining action is to remove spurious arguments for internal kernel
consumers.
2017-02-05 08:04:11 +00:00
..
amd64 Revert r313037 2017-02-04 06:24:49 +00:00
arm Define the vm_ooffset_t and vm_pindex_t types as machine-independend. 2017-02-04 12:26:38 +00:00
arm64 Define the vm_ooffset_t and vm_pindex_t types as machine-independend. 2017-02-04 12:26:38 +00:00
boot loader: libefi/env.c warnings in arm build 2017-02-03 16:39:10 +00:00
bsm
cam Revert crap accidentally committed 2017-01-28 16:31:23 +00:00
cddl Ensure that the DOF string length is divisible by 2. 2017-02-05 02:47:34 +00:00
compat Add kern_pread() and kern_pwrite(), and use it in compats instead 2017-01-31 15:35:18 +00:00
conf For i386, remove config options CPU_DISABLE_CMPXCHG, CPU_DISABLE_SSE 2017-02-03 12:51:40 +00:00
contrib [ath_hal] [ar9300] link in the CAC enable/diable methods and expose it via the HAL. 2017-02-03 05:15:35 +00:00
crypto Remove pc98 support completely. 2017-01-28 02:22:15 +00:00
ddb Revert crap accidentally committed 2017-01-28 16:31:23 +00:00
dev Fix some more overly long lines, whitespace and other bugs according to 2017-02-04 19:35:38 +00:00
fs Revert crap accidentally committed 2017-01-28 16:31:23 +00:00
gdb
geom Check that primary GPT header is valid before wiping partitioning. 2017-02-04 05:09:47 +00:00
gnu Add Ingenic X1000 DTS files (unofficial). 2016-11-19 15:03:49 +00:00
i386 For i386, remove config options CPU_DISABLE_CMPXCHG, CPU_DISABLE_SSE 2017-02-03 12:51:40 +00:00
isa Remove pc98 support completely. 2017-01-28 02:22:15 +00:00
kern mtx: move lockstat handling out of inline primitives 2017-02-05 08:04:11 +00:00
kgssapi
libkern calculate_crc32c: Add SSE4.2 implementation on x86 2017-01-31 03:26:32 +00:00
mips Define the vm_ooffset_t and vm_pindex_t types as machine-independend. 2017-02-04 12:26:38 +00:00
modules Replace the implementation of DTrace's RAND subroutine for generating 2017-02-03 22:26:19 +00:00
net Delete duplicate break. 2017-02-04 18:25:09 +00:00
net80211 [net80211] don't update quiet time counter values every probe request. 2017-02-03 06:04:06 +00:00
netgraph mppc - Finish pluging NETGRAPH_MPPC_COMPRESSION. 2017-01-20 00:02:11 +00:00
netinet Fix VIMAGE-related bugs in TFO. The autokey callout vnet context was 2017-02-03 17:02:57 +00:00
netinet6 Garbage collect IFT_IEEE80211 (but leave the define for possible reuse) 2017-01-28 17:08:40 +00:00
netipsec Add direction argument to ipsec_setspidx_inpcb() function. 2017-01-08 12:40:07 +00:00
netnatm
netpfil Fix indentantion in pf_purge_thread(). No functional change. 2017-01-30 22:47:48 +00:00
netsmb
nfs
nfsclient
nfsserver
nlm
ofed Move the ConnectX-3 and ConnectX-2 driver from sys/ofed into sys/dev/mlx4 2016-09-30 08:23:06 +00:00
opencrypto Add support for the fpu_kern(9) KPI on arm64. It hooks into the existing 2016-10-20 09:22:10 +00:00
powerpc Define the vm_ooffset_t and vm_pindex_t types as machine-independend. 2017-02-04 12:26:38 +00:00
riscv Implement atomic_fcmpset_*() for RISC-V. 2017-02-05 00:32:12 +00:00
rpc
security Audit 'fd' and 'cmd' arguments to fcntl(2), and when generating BSM, 2016-11-22 00:41:24 +00:00
sparc64 Define the vm_ooffset_t and vm_pindex_t types as machine-independend. 2017-02-04 12:26:38 +00:00
sys mtx: move lockstat handling out of inline primitives 2017-02-05 08:04:11 +00:00
teken
tests
tools Replace using of objdump with elfdump 2017-01-10 18:46:40 +00:00
ufs ffs_vnops: Simplify extattr access 2017-01-19 16:46:05 +00:00
vm Style, use tab after #define. 2017-02-04 19:16:19 +00:00
x86 Define the vm_ooffset_t and vm_pindex_t types as machine-independend. 2017-02-04 12:26:38 +00:00
xdr
xen "Buses" is the preferred plural of "bus" 2017-01-15 17:54:01 +00:00
Makefile Remove pc98 support completely. 2017-01-28 02:22:15 +00:00