Lines Matching defs:npages
182 static int vm_page_reclaim_run(int req_class, int domain, u_long npages,
2201 _vm_domain_allocate(struct vm_domain *vmd, int req_class, int npages)
2215 limit += npages;
2220 new = old - npages;
2236 vm_domain_allocate(struct vm_domain *vmd, int req, int npages)
2246 return (_vm_domain_allocate(vmd, req_class, npages));
2385 * Allocate a contiguous set of physical pages of the given size "npages"
2421 u_long npages, vm_paddr_t low, vm_paddr_t high, u_long alignment,
2435 npages, low, high, alignment, boundary, memattr);
2441 npages, low, high) == -1) {
2450 vm_page_find_contig_domain(int domain, int req, u_long npages, vm_paddr_t low,
2461 if (!vm_domain_allocate(vmd, req, npages))
2467 m_ret = vm_phys_alloc_contig(domain, npages, low, high,
2477 m_ret = vm_reserv_reclaim_contig(domain, npages, low,
2483 vm_domain_freecnt_inc(vmd, npages);
2489 int req, u_long npages, vm_paddr_t low, vm_paddr_t high, u_long alignment,
2509 KASSERT(npages > 0, ("vm_page_alloc_contig: npages is zero"));
2522 mpred, npages, low, high, alignment, boundary)) != NULL) {
2526 if ((m_ret = vm_page_find_contig_domain(domain, req, npages,
2547 vm_wire_add(npages);
2551 for (m = m_ret; m < &m_ret[npages]; m++) {
2564 vm_wire_sub(npages);
2568 for (m = m_ret; m < &m_ret[npages]; m++) {
2741 vm_page_alloc_noobj_contig(int req, u_long npages, vm_paddr_t low,
2751 m = vm_page_alloc_noobj_contig_domain(domain, req, npages, low,
2761 vm_page_alloc_noobj_contig_domain(int domain, int req, u_long npages,
2777 KASSERT(npages > 0, ("vm_page_alloc_contig: npages is zero"));
2779 while ((m_ret = vm_page_find_contig_domain(domain, req, npages,
2792 vm_wire_add(npages);
2793 for (m = m_ret; m < &m_ret[npages]; m++) {
2911 * "npages" must be greater than zero. "m_start" and "m_end" must not
2916 vm_page_scan_contig(u_long npages, vm_page_t m_start, vm_page_t m_end,
2927 KASSERT(npages > 0, ("npages is 0"));
2932 for (m = m_start; m < m_end && run_len < npages; m += m_inc) {
2947 if (m + npages > m_end)
2954 if (!vm_addr_bound_ok(pa, ptoa(npages), boundary)) {
3067 if (run_len >= npages)
3090 vm_page_reclaim_run(int req_class, int domain, u_long npages, vm_page_t m_run,
3105 m_end = m_run + npages;
3173 pa += ptoa(npages);
3309 * "npages" must be greater than zero. Both "alignment" and "boundary"
3313 vm_page_reclaim_contig_domain_ext(int domain, int req, u_long npages,
3324 KASSERT(npages > 0, ("npages is 0"));
3347 min_reclaim = MAX(desired_runs * npages, MIN_RECLAIM);
3356 minalign = 1ul << imin(flsl(npages - 1), VM_NFREEORDER - 1);
3357 npages = roundup2(npages, minalign);
3376 if (count < npages + vmd->vmd_free_reserved || (count < npages +
3378 (count < npages && req_class == VM_ALLOC_INTERRUPT))
3395 npages, low, high)) != -1) {
3397 while ((m_run = vm_page_scan_contig(npages, bounds[0],
3399 bounds[0] = m_run + npages;
3422 error = vm_page_reclaim_run(req_class, domain, npages,
3425 reclaimed += npages;
3454 vm_page_reclaim_contig_domain(int domain, int req, u_long npages,
3457 return (vm_page_reclaim_contig_domain_ext(domain, req, npages, low, high,
3462 vm_page_reclaim_contig(int req, u_long npages, vm_paddr_t low, vm_paddr_t high,
3472 status = vm_page_reclaim_contig_domain(domain, req, npages, low,
5764 int i, npages;
5772 npages = atop(pagesizes[psind]);
5779 for (i = 0; i < npages; i++) {