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

Function vm_domain_clear

freebsd/vm/vm_page.c:3095–3133  ·  view source on GitHub ↗

* Clear the domain from the appropriate page level domainset. */

Source from the content-addressed store, hash-verified

3093 * Clear the domain from the appropriate page level domainset.
3094 */
3095void
3096vm_domain_clear(struct vm_domain *vmd)
3097{
3098
3099 mtx_lock(&vm_domainset_lock);
3100 if (vmd->vmd_minset && !vm_paging_min(vmd)) {
3101 vmd->vmd_minset = 0;
3102 DOMAINSET_CLR(vmd->vmd_domain, &vm_min_domains);
3103 if (vm_min_waiters != 0) {
3104 vm_min_waiters = 0;
3105 wakeup(&vm_min_domains);
3106 }
3107 }
3108 if (vmd->vmd_severeset && !vm_paging_severe(vmd)) {
3109 vmd->vmd_severeset = 0;
3110 DOMAINSET_CLR(vmd->vmd_domain, &vm_severe_domains);
3111 if (vm_severe_waiters != 0) {
3112 vm_severe_waiters = 0;
3113 wakeup(&vm_severe_domains);
3114 }
3115 }
3116
3117 /*
3118 * If pageout daemon needs pages, then tell it that there are
3119 * some free.
3120 */
3121 if (vmd->vmd_pageout_pages_needed &&
3122 vmd->vmd_free_count >= vmd->vmd_pageout_free_min) {
3123 wakeup(&vmd->vmd_pageout_pages_needed);
3124 vmd->vmd_pageout_pages_needed = 0;
3125 }
3126
3127 /* See comments in vm_wait_doms(). */
3128 if (vm_pageproc_waiters) {
3129 vm_pageproc_waiters = 0;
3130 wakeup(&vm_pageproc_waiters);
3131 }
3132 mtx_unlock(&vm_domainset_lock);
3133}
3134
3135/*
3136 * Wait for free pages to exceed the min threshold globally.

Callers 1

vm_domain_freecnt_incFunction · 0.85

Calls 5

vm_paging_minFunction · 0.85
vm_paging_severeFunction · 0.85
mtx_lockFunction · 0.50
wakeupFunction · 0.50
mtx_unlockFunction · 0.50

Tested by

no test coverage detected