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

Function vm_wait_domain

freebsd/vm/vm_page.c:3216–3240  ·  view source on GitHub ↗

* vm_wait_domain: * * Sleep until free pages are available for allocation. * - Called in various places after failed memory allocations. */

Source from the content-addressed store, hash-verified

3214 * - Called in various places after failed memory allocations.
3215 */
3216void
3217vm_wait_domain(int domain)
3218{
3219 struct vm_domain *vmd;
3220 domainset_t wdom;
3221
3222 vmd = VM_DOMAIN(domain);
3223 vm_domain_free_assert_unlocked(vmd);
3224
3225 if (curproc == pageproc) {
3226 mtx_lock(&vm_domainset_lock);
3227 if (vmd->vmd_free_count < vmd->vmd_pageout_free_min) {
3228 vmd->vmd_pageout_pages_needed = 1;
3229 msleep(&vmd->vmd_pageout_pages_needed,
3230 &vm_domainset_lock, PDROP | PSWP, "VMWait", 0);
3231 } else
3232 mtx_unlock(&vm_domainset_lock);
3233 } else {
3234 if (pageproc == NULL)
3235 panic("vm_wait in early boot");
3236 DOMAINSET_ZERO(&wdom);
3237 DOMAINSET_SET(vmd->vmd_domain, &wdom);
3238 vm_wait_doms(&wdom, 0);
3239 }
3240}
3241
3242static int
3243vm_wait_flags(vm_object_t obj, int mflags)

Callers 3

vmem_bt_allocFunction · 0.85
vm_domain_alloc_failFunction · 0.85
kmem_alloc_contig_pagesFunction · 0.85

Calls 4

vm_wait_domsFunction · 0.70
mtx_lockFunction · 0.50
mtx_unlockFunction · 0.50
panicFunction · 0.50

Tested by

no test coverage detected