Fix object locking in vm_object_unwire() after r352174.

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.

Reported and tested by:	pho
Reviewed by:	kib
Discussed with:	jeff
Sponsored by:	Intel, Netflix
Differential Revision:	https://reviews.freebsd.org/D21790
This commit is contained in:
markj 2019-09-27 16:41:34 +00:00
parent fcd405d5ab
commit 1b330c2f47

View File

@ -2169,10 +2169,11 @@ again:
m = TAILQ_NEXT(m, listq);
}
if (vm_page_xbusied(tm)) {
for (tobject = object; locked_depth > 1;
for (tobject = object; locked_depth >= 1;
locked_depth--) {
t1object = tobject->backing_object;
VM_OBJECT_RUNLOCK(tobject);
if (tm->object != tobject)
VM_OBJECT_RUNLOCK(tobject);
tobject = t1object;
}
vm_page_busy_sleep(tm, "unwbo", true);