HomeFreeBSD

Fix a race in vm_page_dequeue_deferred().

Description

Fix a race in vm_page_dequeue_deferred().

To detect the case where the page is already marked for a deferred
dequeue, we must read the "queue" and "aflags" fields in a
precise order. Otherwise, a race with a concurrent
vm_page_dequeue_complete() could leave the page with PGA_DEQUEUE
set despite it already having been dequeued. Fix the problem by
using vm_page_queue() to check the queue state, which correctly
handles the race.

Reviewed by: kib
Tested by: pho
MFC after: 3 days
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D19039

Details

Provenance
markjAuthored on
Reviewer
kib
Differential Revision
D19039: Fix a race in vm_page_dequeue_deferred().
Parents
rS343718: MFC r343069:
Branches
Unknown
Tags
Unknown