vm: controller: implement asynchronous DETACH page requests

This commit is contained in:
2026-03-24 20:21:30 +00:00
parent 7dc0c742fa
commit 4be642f2e5
3 changed files with 140 additions and 101 deletions

View File

@@ -29,6 +29,13 @@ static kern_status_t vm_object_cleanup(struct object *obj)
cur = next;
}
if (vmo->vo_ctrl) {
unsigned long flags;
vm_controller_lock_irqsave(vmo->vo_ctrl, &flags);
vm_controller_detach_object(vmo->vo_ctrl, vmo);
vm_controller_unlock_irqrestore(vmo->vo_ctrl, flags);
}
return KERN_OK;
}
@@ -366,12 +373,13 @@ static kern_status_t request_page(
struct vm_controller *ctrl = vo->vo_ctrl;
struct page_request req = {0};
req.req_status = PAGE_REQUEST_PENDING;
req.req_type = PAGE_REQUEST_READ;
req.req_offset = offset;
req.req_length = vm_page_order_to_bytes(VM_PAGE_4K);
req.req_sender = current_thread();
object_ref(&vo->vo_base);
req.req_object = vo;
req.req_object = vo->vo_key;
vm_object_unlock_irqrestore(vo, *irq_flags);
vm_controller_lock_irqsave(ctrl, irq_flags);