* vm_domain_alloc_fail: * * Called when a page allocation function fails. Informs the * pagedaemon and performs the requested wait. Requires the * domain_free and object lock on entry. Returns with the * object lock held and free lock released. Returns an error when * retry is necessary. * */
| 3289 | * |
| 3290 | */ |
| 3291 | static int |
| 3292 | vm_domain_alloc_fail(struct vm_domain *vmd, vm_object_t object, int req) |
| 3293 | { |
| 3294 | |
| 3295 | vm_domain_free_assert_unlocked(vmd); |
| 3296 | |
| 3297 | atomic_add_int(&vmd->vmd_pageout_deficit, |
| 3298 | max((u_int)req >> VM_ALLOC_COUNT_SHIFT, 1)); |
| 3299 | if (req & (VM_ALLOC_WAITOK | VM_ALLOC_WAITFAIL)) { |
| 3300 | if (object != NULL) |
| 3301 | VM_OBJECT_WUNLOCK(object); |
| 3302 | vm_wait_domain(vmd->vmd_domain); |
| 3303 | if (object != NULL) |
| 3304 | VM_OBJECT_WLOCK(object); |
| 3305 | if (req & VM_ALLOC_WAITOK) |
| 3306 | return (EAGAIN); |
| 3307 | } |
| 3308 | |
| 3309 | return (0); |
| 3310 | } |
| 3311 | |
| 3312 | /* |
| 3313 | * vm_waitpfault: |
no test coverage detected