HomeFreeBSD

Fix a race in vm_page_swapqueue().

Description

Fix a race in vm_page_swapqueue().

vm_page_swapqueue() atomically transitions a page between queues. To do
so, it must hold the page queue lock for the old queue. However, once
the queue index has been updated, the queue lock no longer protects the
page's queue state. Thus, we must speculatively remove the page from
the old queue before committing the queue state update, and roll back if
the update fails.

Reported and tested by: pho
Reviewed by: kib
Sponsored by: Intel, Netflix
Differential Revision: https://reviews.freebsd.org/D21791

Details

Provenance
markjAuthored on
Reviewer
kib
Differential Revision
D21791: Fix a race in vm_page_swapqueue().
Parents
rS352801: controlelf: install standard BSD 2 clause license
Branches
Unknown
Tags
Unknown