freebsd-skq/sys
Mark Johnston 99d92d732f Ensure that queue state is cleared when vm_page_dequeue() returns.
Per-page queue state is updated non-atomically, with either the page
lock or the page queue lock held.  When vm_page_dequeue() is called
without the page lock, in rare cases a different thread may be
concurrently dequeuing the page with the pagequeue lock held.  Because
of the non-atomic update, vm_page_dequeue() might return before queue
state is completely updated, which can lead to race conditions.

Restrict the vm_page_dequeue() interface so that it must be called
either with the page lock held or on a free page, and busy wait when
a different thread is concurrently updating queue state, which must
happen in a critical section.

While here, do some related cleanup: inline vm_page_dequeue_locked()
into its only caller and delete a prototype for the unimplemented
vm_page_requeue_locked().  Replace the volatile qualifier for "queue"
added in r333703 with explicit uses of atomic_load_8() where required.

Reported and tested by:	pho
Reviewed by:	alc
Differential Revision:	https://reviews.freebsd.org/D15980
2018-08-23 20:34:22 +00:00
..
amd64 Prepare the kernel linker to handle PC-relative ifunc relocations. 2018-08-22 20:44:30 +00:00
arm a10_timer: Update the driver so we can use it on other SoC 2018-08-23 18:46:05 +00:00
arm64 a10_timer: Update the driver so we can use it on other SoC 2018-08-23 18:46:05 +00:00
bsm
cam Make NVMe compatible with the original API 2018-08-22 04:29:24 +00:00
cddl Add dmu_tx_assign() error handling in zfs_unlinked_drain(). 2018-08-22 16:32:53 +00:00
compat Eliminate kmem_malloc()'s unused arena parameter. (The arena parameter 2018-08-21 16:43:46 +00:00
conf Configure -zifunc-noplt for amd64 kernels. 2018-08-23 19:58:24 +00:00
contrib r338172 follow - remove firmwares 2018-08-22 02:53:35 +00:00
crypto Update userland arc4random() with OpenBSD's Chacha20 based arc4random(). 2018-08-19 17:40:50 +00:00
ddb add an option for ddb ps command to print process arguments 2018-08-09 11:21:31 +00:00
dev Obtain the bus mode (MMC or SD) from the directly superordinated 2018-08-23 20:25:27 +00:00
dts Remove Atmel AT91RM9200 and AT91SAM9 support. 2018-07-27 18:28:22 +00:00
fs FUSE extattrs: fix issue when neither uio nor size were not passed to VOP_* (cosmetic only). 2018-08-21 18:50:29 +00:00
gdb
geom OpenCrypto: Convert sessions to opaque handles instead of integers 2018-07-18 00:56:25 +00:00
gnu dts: Import DTS for arm64 2018-08-23 13:21:01 +00:00
i386 Prepare the kernel linker to handle PC-relative ifunc relocations. 2018-08-22 20:44:30 +00:00
isa Back out r338035 until Warner is finished churning GSoC PNP patches 2018-08-19 00:46:22 +00:00
kern Add a new device flag: DF_ATTACHED_ONCE 2018-08-23 05:06:16 +00:00
kgssapi OpenCrypto: Convert sessions to opaque handles instead of integers 2018-07-18 00:56:25 +00:00
libkern Sync strlcpy with userland version, again 2018-06-21 17:35:13 +00:00
mips Prepare the kernel linker to handle PC-relative ifunc relocations. 2018-08-22 20:44:30 +00:00
modules dtb: Allwinner: Add aarch64 dts files 2018-08-23 13:24:28 +00:00
net Extended pf(4) ioctl interface and pfctl(8) to allow bandwidths of 2018-08-22 19:38:48 +00:00
net80211 Fix misspellings of transmitter/transmitted 2018-08-10 20:37:32 +00:00
netgraph Remove extra M_ZERO from NG_MKRESPONSE() argument. 2018-08-20 14:35:54 +00:00
netinet Use arc4rand() instead of read_random() in the SCTP and TCP code. 2018-08-23 19:10:45 +00:00
netinet6 MFp4 bz_ipv6_fast: 2018-08-23 16:54:22 +00:00
netipsec Use the new VNET_DEFINE_STATIC macro when we are defining static VNET 2018-07-24 16:35:52 +00:00
netpfil Extended pf(4) ioctl interface and pfctl(8) to allow bandwidths of 2018-08-22 19:38:48 +00:00
netsmb Make timespecadd(3) and friends public 2018-07-30 15:46:40 +00:00
nfs Switch RIB and RADIX_NODE_HEAD lock from rwlock(9) to rmlock(9). 2018-06-16 08:26:23 +00:00
nfsclient
nfsserver
nlm
ofed Only NULL check the VNET pointer when VIMAGE is enabled in ibcore. 2018-07-31 11:23:44 +00:00
opencrypto cryptosoft: Reduce generality of supported algorithm composition 2018-08-17 04:40:01 +00:00
powerpc Prepare the kernel linker to handle PC-relative ifunc relocations. 2018-08-22 20:44:30 +00:00
riscv Prepare the kernel linker to handle PC-relative ifunc relocations. 2018-08-22 20:44:30 +00:00
rpc Set SO_SNDTIMEO in the client side krpc when CLSET_TIMEOUT is done. 2018-07-20 12:03:16 +00:00
security Require that MAC label buffers be able to store a non-empty string. 2018-08-01 03:46:07 +00:00
sparc64 Prepare the kernel linker to handle PC-relative ifunc relocations. 2018-08-22 20:44:30 +00:00
sys Remove a redundant #ifdef _KERNEL. 2018-08-23 15:01:27 +00:00
teken teken: Fix sequences header which was crossing the 80-col boundary 2018-05-29 08:41:44 +00:00
tests epoch_test: fix compile 2018-07-15 00:31:17 +00:00
tools make_dtb: Always add root directory in the include path 2018-08-23 13:23:21 +00:00
ufs TRIM consolodation is supposed to be off by default 2018-08-20 21:19:21 +00:00
vm Ensure that queue state is cleared when vm_page_dequeue() returns. 2018-08-23 20:34:22 +00:00
x86 Remove 'imen' global variable from atpic(4). 2018-08-21 17:13:51 +00:00
xdr
xen xen: add missing file from r336474 2018-07-19 10:14:52 +00:00
Makefile