HomeFreeBSD

vm_page: Fix a logic bug in vm_page_unwire_managed()

Description

vm_page: Fix a logic bug in vm_page_unwire_managed()

When releasing a page reference, we have logic for various cases, based
on the value of the counter. But, the implementation fails to take into
account the possibility that the VPRC_BLOCKED flag is set, which is ORed
into the counter for short windows when removing mappings of a page. If
the flag is set while the last reference is being released, we may fail
to add the page to a page queue when the last wiring reference is
released.

Fix the problem by performing comparisons with VPRC_BLOCKED masked off.
While here, add a related assertion.

Reviewed by: dougm, kib
Tested by: pho
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D46944

(cherry picked from commit c59166e5b4e8821556a3d23af7bd17ca556f2e22)

Details

Provenance
markjAuthored on Oct 7 2024, 8:50 PM
Reviewer
dougm
Differential Revision
D46944: vm_page: Fix a logic bug in vm_page_unwire_managed()
Parents
rGbbd018d0aaaf: ping(8): Fix typo in ping6.c
Branches
Unknown
Tags
Unknown