Page MenuHomeFreeBSD

Fix some issues with r352110.
ClosedPublic

Authored by markj on Sep 13 2019, 5:39 PM.
Tags
None
Referenced Files
Unknown Object (File)
Dec 20 2023, 2:37 AM
Unknown Object (File)
Aug 1 2023, 9:22 PM
Unknown Object (File)
Aug 1 2023, 9:22 PM
Unknown Object (File)
Aug 1 2023, 9:21 PM
Unknown Object (File)
Aug 1 2023, 9:09 PM
Unknown Object (File)
Jul 13 2023, 11:22 AM
Unknown Object (File)
Jun 26 2023, 11:15 PM
Unknown Object (File)
Jun 15 2023, 7:19 PM
Subscribers

Details

Summary
  • Man page typos and a dead variable in pmap_extract_and_hold(). (alc)
  • Make vm_page_drop() assert that VPRC_BLOCKED is not the last reference. (kib)
  • Fix a race in vm_page_dequeue_deferred_free(). (pho)
  • Fix a page leak in vm_page_reclaim_run().

The race is due to the fact that the queue index may change after we
load it and before we set PGA_DEQUEUE. This currently can happen if the
page daemon uses vm_page_swapqueue() to deactivate a page as it is being
freed. To fix this, use a vm_page_pqstate_cmpset() loop in
vm_page_dequeue_deferred_free(). This ensures that we submit the page
to the right batch queue. The PGA_DEQUEUE flag acts as a barrier in
that vm_page_swapqueue() and vm_page_dequeue_deferred() will not update
a page that has PGA_DEQUEUE set.

I noticed the page leak while reading code. Just free the newly
allocated page if we lost the race with a wiring. If the page is
unmapped, an earlier check guarantees that the page being replaced does
not carry any wirings.

Test Plan

Peter is testing part of the change.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

markj added reviewers: alc, kib, dougm, jeff.
This revision is now accepted and ready to land.Sep 13 2019, 5:58 PM
This revision was automatically updated to reflect the committed changes.