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 4 2025, 11:11 AM
Unknown Object (File)
Aug 15 2025, 9:54 PM
Unknown Object (File)
Aug 2 2025, 7:13 AM
Unknown Object (File)
Jul 21 2025, 7:10 PM
Unknown Object (File)
Jul 21 2025, 6:51 PM
Unknown Object (File)
Jun 22 2025, 4:11 PM
Unknown Object (File)
Jun 16 2025, 6:27 PM
Unknown Object (File)
Jun 14 2025, 4:37 PM
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