1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-27 11:55:06 +00:00
freebsd/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
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
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
libkern
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
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
nfs
nfsclient
nfsserver
nlm
ofed Remove redundant integer cast in ibcore. The "ref_count" field already 2018-03-19 13:51:33 +00:00
opencrypto
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
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
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