freebsd-nq/sys
Jonathan T. Looney 7fb2986ff6 If the INP lock is uncontested, avoid taking a reference and jumping
through the lock-switching hoops.

A few of the INP lookup operations that lock INPs after the lookup do
so using this mechanism (to maintain lock ordering):

1. Lock lookup structure.
2. Find INP.
3. Acquire reference on INP.
4. Drop lock on lookup structure.
5. Acquire INP lock.
6. Drop reference on INP.

This change provides a slightly shorter path for cases where the INP
lock is uncontested:

1. Lock lookup structure.
2. Find INP.
3. Try to acquire the INP lock.
4. If successful, drop lock on lookup structure.

Of course, if the INP lock is contested, the functions will need to
revert to the previous way of switching locks safely.

This saves a few atomic operations when the INP lock is uncontested.

Discussed with:	gallatin, rrs, rwatson
MFC after:	2 weeks
Sponsored by:	Netflix, Inc.
Differential Revision:	https://reviews.freebsd.org/D12911
2018-03-21 15:54:46 +00:00
..
amd64 Move the CR0.WP manipulation KPI to x86. 2018-03-20 20:20:49 +00:00
arm This is MPSAFE on this platform, so don't take Giant out while running 2018-03-21 14:47:08 +00:00
arm64 Rename assym.s to assym.inc 2018-03-20 17:58:51 +00:00
bsm
cam Revert r331273: "Release the "TUR" reference when clearing the TUR work flag. We mostly" 2018-03-21 12:55:59 +00:00
cddl Revert part of r331264: disable interrupts before disabling WP. 2018-03-20 21:36:35 +00:00
compat Regenerate sysent files after r331279. 2018-03-21 01:17:01 +00:00
conf Implement getrandom(2) and getentropy(3) 2018-03-21 01:15:45 +00:00
contrib lib(private)zstd: Fix riscv build 2018-03-18 03:42:57 +00:00
crypto Garbage collect unused chacha20 code 2018-03-16 07:11:53 +00:00
ddb db_script_exec: use a saved script name when reporting commands executed 2018-03-04 13:27:21 +00:00
dev Use a table to find the endpoint configuration 2018-03-21 15:17:54 +00:00
dts sys/dts: Remove arm64 from subdir as it no longer exists. 2018-03-19 15:35:26 +00:00
fs Revert r313780 (UFS_ prefix) 2018-03-17 12:59:55 +00:00
gdb amd64: Protect the kernel text, data, and BSS by setting the RW/NX bits 2018-03-06 14:28:37 +00:00
geom Remove unneeded variable which was introduced in r328472. 2018-03-18 15:09:55 +00:00
gnu bwn(4): txpid2g/txpid5g[lh] are not defined after sromrev 7; the default 2018-02-13 17:43:54 +00:00
i386 Restore close quote lost in r331254 2018-03-20 21:04:47 +00:00
isa Revert r330780, it was improperly tested and results in taking a spin 2018-03-11 20:13:15 +00:00
kern bufshutdown is no longer called with Giant held, so there's no need to 2018-03-21 14:46:59 +00:00
kgssapi kgssapi: Remove trivial deadcode 2018-02-14 00:12:03 +00:00
libkern iconv uses strlen directly on user supplied memory 2018-02-26 18:23:36 +00:00
mips Rename assym.s to assym.inc 2018-03-20 17:58:51 +00:00
modules Rename assym.s to assym.inc 2018-03-20 17:58:51 +00:00
net Use count(9) api for the bpf(4) statistics. 2018-03-20 22:57:06 +00:00
net80211 net80211: wrap protection frame allocation into ieee80211_alloc_prot() 2018-03-09 11:33:56 +00:00
netgraph Correct pseudo misspelling in sys/ comments 2018-02-23 18:15:50 +00:00
netinet If the INP lock is uncontested, avoid taking a reference and jumping 2018-03-21 15:54:46 +00:00
netinet6 If the INP lock is uncontested, avoid taking a reference and jumping 2018-03-21 15:54:46 +00:00
netipsec Set the proper vnet in IPsec callback functions. 2018-03-20 17:05:23 +00:00
netpfil pf: Fix memory leak in DIOCRADDTABLES 2018-03-19 21:13:25 +00:00
netsmb Unsign some values related to allocation. 2018-01-22 02:08:10 +00:00
nfs Modernize nfssvc(2) registartion. 2018-02-08 20:09:42 +00:00
nfsclient style: Remove remaining deprecated MALLOC/FREE macros 2018-01-25 22:25:13 +00:00
nfsserver
nlm Use syscall_helper_register() to register syscalls and initialize though 2018-02-10 01:09:22 +00:00
ofed Remove redundant integer cast in ibcore. The "ref_count" field already 2018-03-19 13:51:33 +00:00
opencrypto Move per-operation data out of the csession structure. 2018-01-26 23:21:50 +00:00
powerpc Rename assym.s to assym.inc 2018-03-20 17:58:51 +00:00
riscv Rename assym.s to assym.inc 2018-03-20 17:58:51 +00:00
rpc Do pass removing some write-only variables from the kernel. 2017-12-25 04:48:39 +00:00
security audit(4): fix a typo in a comment 2018-03-17 17:56:08 +00:00
sparc64 Mark psycho interrupts as MPSAFE. It's safe to do so now that we don't 2018-03-21 14:47:17 +00:00
sys Move sysinit and sysuninit linker sets in the data (writeable) section. 2018-03-21 10:26:39 +00:00
teken
tests
tools Avoid using \$. It's an unknown escape sequence. Some awks warn about 2018-01-28 05:13:08 +00:00
ufs Revert r313780 (UFS_ prefix) 2018-03-17 12:59:55 +00:00
vm Check for wrap-around in vm_phys_alloc_seg_contig(). 2018-03-20 16:17:55 +00:00
x86 Move the CR0.WP manipulation KPI to x86. 2018-03-20 20:20:49 +00:00
xdr
xen
Makefile