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

Function vm_waitpfault

freebsd/vm/vm_page.c:3322–3338  ·  view source on GitHub ↗

* vm_waitpfault: * * Sleep until free pages are available for allocation. * - Called only in vm_fault so that processes page faulting * can be easily tracked. * - Sleeps at a lower priority than vm_wait() so that vm_wait()ing * processes will be able to grab memory first. Do not change * this balance without careful testing first. */

Source from the content-addressed store, hash-verified

3320 * this balance without careful testing first.
3321 */
3322void
3323vm_waitpfault(struct domainset *dset, int timo)
3324{
3325
3326 /*
3327 * XXX Ideally we would wait only until the allocation could
3328 * be satisfied. This condition can cause new allocators to
3329 * consume all freed pages while old allocators wait.
3330 */
3331 mtx_lock(&vm_domainset_lock);
3332 if (vm_page_count_min_set(&dset->ds_mask)) {
3333 vm_min_waiters++;
3334 msleep(&vm_min_domains, &vm_domainset_lock, PUSER | PDROP,
3335 "pfault", timo);
3336 } else
3337 mtx_unlock(&vm_domainset_lock);
3338}
3339
3340static struct vm_pagequeue *
3341_vm_page_pagequeue(vm_page_t m, uint8_t queue)

Callers 1

vm_fault_allocateFunction · 0.85

Calls 3

vm_page_count_min_setFunction · 0.85
mtx_lockFunction · 0.50
mtx_unlockFunction · 0.50

Tested by

no test coverage detected