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

Function vm_page_pqbatch_drain

freebsd/vm/vm_page.c:3627–3657  ·  view source on GitHub ↗

* vm_page_pqbatch_drain: [ internal use only ] * * Force all per-CPU page queue batch queues to be drained. This is * intended for use in severe memory shortages, to ensure that pages * do not remain stuck in the batch queues. */

Source from the content-addressed store, hash-verified

3625 * do not remain stuck in the batch queues.
3626 */
3627void
3628vm_page_pqbatch_drain(void)
3629{
3630 struct thread *td;
3631 struct vm_domain *vmd;
3632 struct vm_pagequeue *pq;
3633 int cpu, domain, queue;
3634
3635 td = curthread;
3636 CPU_FOREACH(cpu) {
3637 thread_lock(td);
3638 sched_bind(td, cpu);
3639 thread_unlock(td);
3640
3641 for (domain = 0; domain < vm_ndomains; domain++) {
3642 vmd = VM_DOMAIN(domain);
3643 for (queue = 0; queue < PQ_COUNT; queue++) {
3644 pq = &vmd->vmd_pagequeues[queue];
3645 vm_pagequeue_lock(pq);
3646 critical_enter();
3647 vm_pqbatch_process(pq,
3648 DPCPU_PTR(pqbatch[domain][queue]), queue);
3649 critical_exit();
3650 vm_pagequeue_unlock(pq);
3651 }
3652 }
3653 }
3654 thread_lock(td);
3655 sched_unbind(td);
3656 thread_unlock(td);
3657}
3658
3659/*
3660 * vm_page_dequeue_deferred: [ internal use only ]

Callers 1

vm_daemonFunction · 0.85

Calls 5

vm_pqbatch_processFunction · 0.85
sched_bindFunction · 0.50
critical_enterFunction · 0.50
critical_exitFunction · 0.50
sched_unbindFunction · 0.50

Tested by

no test coverage detected