Page MenuHomeFreeBSD

Fix object unlocking in vm_object_unwire() after r352174.

Authored by markj on Sep 25 2019, 4:15 PM.



Now, vm_page_busy_sleep() expects the page's object to be locked.
vm_object_unwire() does some unusual lazy locking of the object chain,
and keeps objects locked until a busy page is encountered or the loop
terminates. When a busy page is encountered, rather than unlocking all
but the "bottom-level" object, we must instead skip the object to which
tm belongs.

To provide a concrete example, suppose we are asked to unwire pages
in the range [0, 1] from object O, with backing object BO with offset 0.
Suppose no page is resident at 0 in O, but an xbusy page is resident at 1
in O. BO must contain a page at 0. vm_object_unwire() will lock
both O and BO to unwire the page at 0. It would then encounter the
busy page at 1 in O, and it must unlock BO, not O, before sleeping on
the page's busy state.

Test Plan

Peter reported the bug and is testing the diff.

Diff Detail

rS FreeBSD src repository
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

markj created this revision.Sep 25 2019, 4:15 PM
markj edited the summary of this revision. (Show Details)Sep 25 2019, 4:20 PM
markj edited the test plan for this revision. (Show Details)
markj added reviewers: alc, kib, jeff.
kib accepted this revision.Sep 25 2019, 6:44 PM
This revision is now accepted and ready to land.Sep 25 2019, 6:44 PM
This revision was automatically updated to reflect the committed changes.