MCPcopy Create free account
hub / github.com/F-Stack/f-stack / vm_domain_alloc_fail

Function vm_domain_alloc_fail

freebsd/vm/vm_page.c:3291–3310  ·  view source on GitHub ↗

* 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. * */

Source from the content-addressed store, hash-verified

3289 *
3290 */
3291static int
3292vm_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:

Callers 3

Calls 2

maxFunction · 0.85
vm_wait_domainFunction · 0.85

Tested by

no test coverage detected