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)
Dec 31 2023, 7:05 AM
Unknown Object (File)
Dec 22 2023, 11:13 PM
Unknown Object (File)
Nov 8 2023, 6:32 AM
Unknown Object (File)
Sep 16 2023, 9:51 PM
Unknown Object (File)
Aug 13 2023, 6:26 AM
Unknown Object (File)
Aug 2 2023, 6:18 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