* 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. */
| 3625 | * do not remain stuck in the batch queues. |
| 3626 | */ |
| 3627 | void |
| 3628 | vm_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 ] |
no test coverage detected