HomeFreeBSD

Fix a race in vm_page_dequeue_deferred_free() after r352110.

Description

Fix a race in vm_page_dequeue_deferred_free() after r352110.

This function loaded the page's queue index before setting PGA_DEQUEUE.
In this window the page daemon may have deactivated the page, updating
its queue index. Make the operation atomic using vm_page_pqstate_cmpset();
the page daemon will not modify the page once it observes that PGA_DEQUEUE
is set.

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

Details

Provenance
markjAuthored on
Reviewer
alc
Differential Revision
D21639: Fix some issues with r352110.
Parents
rS352409: Fix a page leak in vm_page_reclaim_run().
Branches
Unknown
Tags
Unknown