Page MenuHomeFreeBSD

Fix object unlocking in vm_object_unwire() after r352174.
ClosedPublic

Authored by markj on Sep 25 2019, 4:15 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sep 30 2024, 5:06 PM
Unknown Object (File)
Sep 24 2024, 4:50 PM
Unknown Object (File)
Sep 22 2024, 2:36 AM
Unknown Object (File)
Sep 20 2024, 11:52 PM
Unknown Object (File)
Sep 8 2024, 11:39 PM
Unknown Object (File)
Sep 8 2024, 10:12 AM
Unknown Object (File)
Sep 5 2024, 3:03 PM
Unknown Object (File)
Sep 1 2024, 10:32 AM
Subscribers

Details

Summary

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

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