1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-10-18 02:19:39 +00:00
freebsd/sys
Mark Johnston 2c9dc2384f vm_page: Fix a logic error in the handling of PQ_ACTIVE operations
As an optimization, vm_page_activate() avoids requeuing a page that's
already in the active queue.  A page's location in the active queue is
mostly unimportant.

When a page is unwired and placed back in the page queues,
vm_page_unwire() avoids moving pages out of PQ_ACTIVE to honour the
request, the idea being that they're likely mapped and so will simply
get bounced back in to PQ_ACTIVE during a queue scan.

In both cases, if the page was logically in PQ_ACTIVE but had not yet
been physically enqueued (i.e., the page is in a per-CPU batch), we
would end up clearing PGA_REQUEUE from the page.  Then, batch processing
would ignore the page, so it would end up unwired and not in any queues.
This can arise, for example, when a page is allocated and then
vm_page_activate() is called multiple times in quick succession.  The
result is that the page is hidden from the page daemon, so while it will
be freed when its VM object is destroyed, it cannot be reclaimed under
memory pressure.

Fix the bug: when checking if a page is in PQ_ACTIVE, only perform the
optimization if the page is physically enqueued.

PR:		256507
Fixes:		f3f38e2580 ("Start implementing queue state updates using fcmpset loops.")
Reviewed by:	alc, kib
MFC after:	1 week
Sponsored by:	E-CARD Ltd.
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D36839
2022-10-05 15:12:46 -04:00
..
amd64 amd64/db_trace.c: remove stray prototype 2022-10-04 01:50:30 +03:00
arm Teach the GICv3 driver to translate memory ranges 2022-09-23 15:28:45 +01:00
arm64 Clear the indirect flag in the GICv3 ITS driver 2022-10-04 17:14:16 +01:00
bsm
cam cam: Provide compatibility for CAMGETPASSTHRU for periph drivers 2022-09-29 13:14:57 -04:00
cddl dtrace: Add a "regs" variable 2022-10-04 13:05:54 -04:00
compat linuxolator: add netlink support 2022-10-01 14:16:45 +00:00
conf arm64: coresight: fix the build without FDT 2022-09-29 14:33:33 -05:00
contrib zfs: merge openzfs/zfs@d62bafee9 2022-10-04 20:16:52 +02:00
crypto Fix the IV length in the armv8 AES GCM code 2022-09-06 13:11:04 +01:00
ddb Fix kernel build after 754cb545b6 . 2022-10-04 17:13:17 +02:00
dev usb(4): Make sure the enumeration thread doesn't loop too fast. 2022-10-05 12:12:33 +02:00
dts sys/dts: Remove MIPS files 2022-05-20 17:11:27 +01:00
fs cuse(3): Cosmetic change about testing boolean values. 2022-10-04 13:51:06 +02:00
gdb ddb: use _FLAGS command macros where appropriate 2022-07-05 11:56:55 -03:00
geom Adjust g_waitidle() visibility and definition 2022-08-02 21:11:10 +03:00
gnu
i386 ddb: de-duplicate decode_syscall() 2022-10-03 13:49:54 -03:00
isa Adjust function definition in isa's pnp.c to avoid clang 15 warning 2022-07-27 21:13:59 +02:00
kern Remove pre-armv6 support from devmap 2022-10-05 09:56:17 +01:00
kgssapi
libkern qdivrem: Predict division by zero as false. 2022-10-04 13:51:06 +02:00
modules netlink: fix standalone module build 2022-10-04 14:38:40 -07:00
net pf: use time_to for timestamps 2022-10-05 17:52:27 +02:00
net80211 net80211: move IEEE80211_F_WME check to vap for consistency 2022-09-29 12:54:23 +00:00
netgraph Alter the prototype of qsort_r(3) to match POSIX, which adopted the 2022-09-30 15:26:30 -07:00
netinet Fix kernel build after fcb3f813f3 . 2022-10-04 15:55:36 +02:00
netinet6 netinet*: remove PRC_ constants and streamline ICMP processing 2022-10-03 20:53:04 -07:00
netipsec Fix kernel build after fcb3f813f3 . 2022-10-04 15:42:51 +02:00
netlink netlink: make it working without INET6 2022-10-04 14:39:49 -07:00
netpfil pf: use time_to for timestamps 2022-10-05 17:52:27 +02:00
netsmb
nfs nfs: skip bootpc when vfs.root.mountfrom is other than nfs 2022-05-31 16:07:27 -03:00
nfsclient
nfsserver
nlm
ofed ibcore: The use of IN_LOOPBACK() now requires a valid VNET context. 2022-09-23 13:42:03 +02:00
opencrypto opencrypto: mark INVARIANTS variables as __diagused 2022-08-10 15:35:29 -04:00
powerpc powerpc: slb_alloc_user_cache: fix missing uma_zalloc wait flag 2022-10-03 20:56:41 -03:00
riscv riscv: Apply 8d7ee2047c to the riscv pmap 2022-10-04 13:05:54 -04:00
rpc nfsd: Allow multiple instances of rpc.tlsservd 2022-08-22 13:54:24 -07:00
security vfs: introduce V_PCATCH to stop abusing PCATCH 2022-09-17 15:41:37 +00:00
sys time(3): Increase precision of time conversion functions by using gcd. 2022-10-04 13:51:06 +02:00
teken
tests
tools sound(4): Fix order of parameters for custom equalizer band pass filter. 2022-08-22 10:04:26 +02:00
ufs Updates to UFS/FFS superblock integrity checks when reading a superblock. 2022-10-03 05:53:10 -07:00
vm vm_page: Fix a logic error in the handling of PQ_ACTIVE operations 2022-10-05 15:12:46 -04:00
x86 Fix various places which cast a pointer to a vm_paddr_t or vice versa. 2022-10-03 16:10:41 -07:00
xdr
xen xenbus: improve device tracking 2022-06-07 12:29:53 +02:00
Makefile