freebsd-dev/sys
Gleb Smirnoff 779f106aa1 Listening sockets improvements.
o Separate fields of struct socket that belong to listening from
  fields that belong to normal dataflow, and unionize them.  This
  shrinks the structure a bit.
  - Take out selinfo's from the socket buffers into the socket. The
    first reason is to support braindamaged scenario when a socket is
    added to kevent(2) and then listen(2) is cast on it. The second
    reason is that there is future plan to make socket buffers pluggable,
    so that for a dataflow socket a socket buffer can be changed, and
    in this case we also want to keep same selinfos through the lifetime
    of a socket.
  - Remove struct struct so_accf. Since now listening stuff no longer
    affects struct socket size, just move its fields into listening part
    of the union.
  - Provide sol_upcall field and enforce that so_upcall_set() may be called
    only on a dataflow socket, which has buffers, and for listening sockets
    provide solisten_upcall_set().

o Remove ACCEPT_LOCK() global.
  - Add a mutex to socket, to be used instead of socket buffer lock to lock
    fields of struct socket that don't belong to a socket buffer.
  - Allow to acquire two socket locks, but the first one must belong to a
    listening socket.
  - Make soref()/sorele() to use atomic(9).  This allows in some situations
    to do soref() without owning socket lock.  There is place for improvement
    here, it is possible to make sorele() also to lock optionally.
  - Most protocols aren't touched by this change, except UNIX local sockets.
    See below for more information.

o Reduce copy-and-paste in kernel modules that accept connections from
  listening sockets: provide function solisten_dequeue(), and use it in
  the following modules: ctl(4), iscsi(4), ng_btsocket(4), ng_ksocket(4),
  infiniband, rpc.

o UNIX local sockets.
  - Removal of ACCEPT_LOCK() global uncovered several races in the UNIX
    local sockets.  Most races exist around spawning a new socket, when we
    are connecting to a local listening socket.  To cover them, we need to
    hold locks on both PCBs when spawning a third one.  This means holding
    them across sonewconn().  This creates a LOR between pcb locks and
    unp_list_lock.
  - To fix the new LOR, abandon the global unp_list_lock in favor of global
    unp_link_lock.  Indeed, separating these two locks didn't provide us any
    extra parralelism in the UNIX sockets.
  - Now call into uipc_attach() may happen with unp_link_lock hold if, we
    are accepting, or without unp_link_lock in case if we are just creating
    a socket.
  - Another problem in UNIX sockets is that uipc_close() basicly did nothing
    for a listening socket.  The vnode remained opened for connections.  This
    is fixed by removing vnode in uipc_close().  Maybe the right way would be
    to do it for all sockets (not only listening), simply move the vnode
    teardown from uipc_detach() to uipc_close()?

Sponsored by:		Netflix
Differential Revision:	https://reviews.freebsd.org/D9770
2017-06-08 21:30:34 +00:00
..
amd64 Eliminate duplication of the pmap and pv list unlock operations in 2017-06-03 17:24:13 +00:00
arm Add function to dump PCIE MBUS decoding windows and bars 2017-06-08 16:57:06 +00:00
arm64 - Don't bother flushing the data cache for pages we're about to unmap, there's 2017-06-02 14:17:14 +00:00
boot Restore DTS node of PCIe controller for A38X boards 2017-06-08 16:55:58 +00:00
bsm Commit the 64-bit inode project. 2017-05-23 09:29:05 +00:00
cam Listening sockets improvements. 2017-06-08 21:30:34 +00:00
cddl zfs_lookup: fix bogus arguments to lookup of "snapshot" directory 2017-05-29 06:30:34 +00:00
compat Remove ARM and MIPS from linuxkpi ioremap_attr definition 2017-06-08 02:44:34 +00:00
conf Add the infrastructure to support loading multiple versions of TCP 2017-06-08 20:41:28 +00:00
contrib [iwmfw] 8000C ver 22 firmware. 2017-06-04 21:27:39 +00:00
crypto Remove register keyword from sys/ and ANSIfy prototypes 2017-05-17 00:34:34 +00:00
ddb Remove register keyword from sys/ and ANSIfy prototypes 2017-05-17 00:34:34 +00:00
dev Listening sockets improvements. 2017-06-08 21:30:34 +00:00
fs ext2fs(4): Fix a null dererence and clean an unclear switch 2017-06-03 22:39:50 +00:00
gdb
geom Add MD_VERIFY option to enable O_VERIFY in open for vnode type. 2017-05-31 21:18:11 +00:00
gnu [mips] [rt2880] Add oldest Ralink MIPS SOC RT2880 support code. 2017-05-06 06:20:34 +00:00
i386 Remove the BSD/OS 2.1 system call gate LDT entry. 2017-05-23 22:34:18 +00:00
isa Renumber copyright clause 4 2017-02-28 23:42:47 +00:00
kern Listening sockets improvements. 2017-06-08 21:30:34 +00:00
kgssapi
libkern arm64: add ".arch armv8-a+crc" to allow use of crc instructions 2017-06-08 20:06:09 +00:00
mips Remove unused tlb_write_random(). 2017-06-05 11:04:22 +00:00
modules [iwmfw] bump built firmware now to version 22 for 7265D and 8000C. 2017-06-04 21:28:03 +00:00
net Call VLAN_CAPABILITIES() when LAGG capabilities change. 2017-05-26 22:22:48 +00:00
net80211 net80211: initialize i_seq for A-MPDU frames. 2017-06-01 20:46:43 +00:00
netgraph Listening sockets improvements. 2017-06-08 21:30:34 +00:00
netinet Listening sockets improvements. 2017-06-08 21:30:34 +00:00
netinet6 Fix an unnecessary/incorrect check in the PKTOPT_EXTHDRCPY macro. 2017-05-30 14:50:28 +00:00
netipsec Build kdebug_secreplay() function only when IPSEC_DEBUG is defined. 2017-06-01 10:04:12 +00:00
netpfil Fix the queue delay estimation in PIE/FQ-PIE when the timestamp 2017-05-19 08:38:03 +00:00
netsmb
nfs Renumber copyright clause 4 2017-02-28 23:42:47 +00:00
nfsclient Add an NFSv4.1 mount option for "use one openowner". 2017-04-13 21:54:19 +00:00
nfsserver Renumber copyright clause 4 2017-02-28 23:42:47 +00:00
nlm Commit the 64-bit inode project. 2017-05-23 09:29:05 +00:00
ofed Listening sockets improvements. 2017-06-08 21:30:34 +00:00
opencrypto Use const with some read-only buffers in opencrypto APIs. 2017-05-09 18:28:42 +00:00
powerpc Add a driver for the Chelsio T6 crypto accelerator engine. 2017-05-17 22:13:07 +00:00
riscv Follow r317061 "Remove struct vmmeter from struct pcpu" 2017-04-19 17:06:32 +00:00
rpc Listening sockets improvements. 2017-06-08 21:30:34 +00:00
security Commit the 64-bit inode project. 2017-05-23 09:29:05 +00:00
sparc64 fix sparc64 build by restoring 'register' in pcpu.h 2017-05-17 16:32:24 +00:00
sys Listening sockets improvements. 2017-06-08 21:30:34 +00:00
teken Oops, my fix for bright colors broke bright black some more (in cases 2017-03-27 10:48:28 +00:00
tests style(9): sort headers 2017-05-09 05:08:47 +00:00
tools Declare the "snd_fxdiv_table" once. This shaves around 24Kbytes of 2017-05-25 05:23:47 +00:00
ufs Mitigate several problems with the softdep_request_cleanup() on busy 2017-06-03 16:18:50 +00:00
vm Fix an off-by-one error in the VM page array on some systems. 2017-06-08 16:18:41 +00:00
x86 Allow sysctl kern.vm_guest to return bhyve when running under bhyve. 2017-06-08 04:02:14 +00:00
xdr * limit size of buffers to RPC_MAXDATASIZE 2017-06-01 06:12:25 +00:00
xen xenstore: fix suspension when using the xenstore device 2017-03-07 09:17:48 +00:00
Makefile Remove glimpse make target added in r181432 2017-05-22 15:53:30 +00:00