/freebsd/contrib/netbsd-tests/sys/uvm/ |
H A D | t_uvm_physseg.c | 281 uvmexp.npages = 0; in setup() 501 , uvmexp.npages); in ATF_TC_BODY() 510 + npages3, uvmexp.npages); in ATF_TC_BODY() 800 for (i = 0; i < npages; i++) { in ATF_TC_BODY() 813 for (i = 0; i < npages; i++) { in ATF_TC_BODY() 885 seg->end = npages; in ATF_TC_BODY() 888 seg->avail_end = npages; in ATF_TC_BODY() 892 ATF_REQUIRE_EQ(npages, uvmexp.npages); in ATF_TC_BODY() 914 ATF_CHECK_EQ(0, uvmexp.npages); 1382 ATF_CHECK_EQ(0, uvmexp.npages); in ATF_TC_BODY() [all …]
|
/freebsd/sys/dev/mlx5/mlx5_core/ |
H A D | mlx5_pagealloc.c | 40 s32 npages; member 391 u32 npages; in reclaim_pages_cmd() local 466 if (req->npages < 0) in pages_work_handler() 479 s32 npages) in mlx5_core_req_pages_handler() argument 491 req->npages = npages; in mlx5_core_req_pages_handler() 510 if (npages > 0) in mlx5_satisfy_startup_pages() 524 s64 npages = 0; in mlx5_wait_for_reclaim_vfs_pages() local 529 if (!npages) in mlx5_wait_for_reclaim_vfs_pages() 535 prevpages = npages; in mlx5_wait_for_reclaim_vfs_pages() 539 if (npages) in mlx5_wait_for_reclaim_vfs_pages() [all …]
|
H A D | mlx5_alloc.c | 77 buf->npages = howmany(size, PAGE_SIZE); in mlx5_buf_alloc() 81 buf->page_list = kcalloc(buf->npages, sizeof(*buf->page_list), in mlx5_buf_alloc() 91 PAGE_SIZE * buf->npages, /* maxsize */ in mlx5_buf_alloc() 92 buf->npages, /* nsegments */ in mlx5_buf_alloc() 111 PAGE_SIZE * buf->npages, &mlx5_buf_load_mem_cb, in mlx5_buf_alloc() 125 memset(buf->direct.buf, 0, PAGE_SIZE * buf->npages); in mlx5_buf_alloc() 251 for (i = 0; i != buf->npages; i++) in mlx5_fill_page_array()
|
/freebsd/sys/dev/drm2/ttm/ |
H A D | ttm_page_alloc.c | 71 unsigned npages; member 670 count -= pool->npages; in ttm_page_pool_get_pages() 671 pool->npages = 0; in ttm_page_pool_get_pages() 679 pool->npages -= count; in ttm_page_pool_get_pages() 709 pool->npages++; in ttm_put_pages() 713 npages = 0; in ttm_put_pages() 715 npages = pool->npages - _manager->options.max_size; in ttm_put_pages() 722 if (npages) in ttm_put_pages() 758 npages = ttm_page_pool_get_pages(pool, &plist, flags, cstate, npages); in ttm_get_pages() 772 if (npages > 0) { in ttm_get_pages() [all …]
|
/freebsd/sys/vm/ |
H A D | vm_phys.c | 498 u_long npages; in vm_phys_init() local 510 npages = 0; in vm_phys_init() 556 npages = 0; in vm_phys_init() 740 m, npages)); in vm_phys_enq_range() 741 while (npages > 0) { in vm_phys_enq_range() 806 if (i == npages) { in vm_phys_alloc_npages() 812 return (npages); in vm_phys_alloc_npages() 835 return (npages); in vm_phys_alloc_npages() 1191 m_end = m + npages; in vm_phys_enqueue_contig() 1234 m_end = m + npages; in vm_phys_free_contig() [all …]
|
H A D | vm_reserv.c | 588 pindex + npages > object->size) in vm_reserv_alloc_contig() 602 size = npages << PAGE_SHIFT; in vm_reserv_alloc_contig() 633 for (i = 0; i < npages; i++) in vm_reserv_alloc_contig() 717 vm_domain_freecnt_inc(vmd, npages); in vm_reserv_alloc_contig() 743 npages -= n; in vm_reserv_alloc_contig() 1071 KASSERT(npages <= VM_LEVEL_0_NPAGES, in vm_reserv_is_populated() 1073 KASSERT(powerof2(npages), in vm_reserv_is_populated() 1192 KASSERT(npages <= ppn_bound, in vm_reserv_find_contig() 1231 if (npages > VM_LEVEL_0_NPAGES - 1) in vm_reserv_reclaim_contig() 1233 size = npages << PAGE_SHIFT; in vm_reserv_reclaim_contig() [all …]
|
H A D | vm_phys.h | 62 vm_page_t vm_phys_alloc_contig(int domain, u_long npages, vm_paddr_t low, 66 int vm_phys_alloc_npages(int domain, int pool, int npages, vm_page_t ma[]); 69 void vm_phys_enqueue_contig(vm_page_t m, u_long npages); 75 u_long npages, vm_paddr_t low, vm_paddr_t high); 76 void vm_phys_free_contig(vm_page_t m, u_long npages);
|
/freebsd/lib/libgeom/ |
H A D | geom_stats.c | 48 static uint npages, spp; variable 57 munmap(statp, npages * pagesize); in geom_stats_close() 76 munmap(statp, npages * pagesize); in geom_stats_resync() 82 npages = mediasize / pagesize; in geom_stats_resync() 108 npages = 1; in geom_stats_open() 132 sp->ptr = malloc(pagesize * npages); in geom_stats_snapshot_get() 137 explicit_bzero(sp->ptr, pagesize * npages); /* page in, cache */ in geom_stats_snapshot_get() 139 memcpy(sp->ptr, statp, pagesize * npages); in geom_stats_snapshot_get() 140 sp->pages = npages; in geom_stats_snapshot_get()
|
/freebsd/sys/ofed/drivers/infiniband/core/ |
H A D | ib_umem.c | 62 for_each_sg(umem->sg_head.sgl, sg, umem->npages, i) { in __ib_umem_release() 93 unsigned long npages; in ib_umem_get() local 157 npages = ib_umem_num_pages(umem); in ib_umem_get() 161 locked = npages + current->mm->pinned_vm; in ib_umem_get() 165 if (npages == 0 || npages > UINT_MAX) { in ib_umem_get() 170 ret = sg_alloc_table(&umem->sg_head, npages, GFP_KERNEL); in ib_umem_get() 180 while (npages) { in ib_umem_get() 182 min_t(unsigned long, npages, in ib_umem_get() 189 umem->npages += ret; in ib_umem_get() 191 npages -= ret; in ib_umem_get() [all …]
|
H A D | ib_core_uverbs.c | 198 if (entry->npages * PAGE_SIZE != vma->vm_end - vma->vm_start) { in rdma_user_mmap_entry_get() 218 for (i = 0; i < entry->npages; i++) in rdma_user_mmap_entry_free() 292 u32 xa_first, xa_last, npages; in rdma_user_mmap_entry_insert_range() local 314 npages = (u32)DIV_ROUND_UP(length, PAGE_SIZE); in rdma_user_mmap_entry_insert_range() 315 entry->npages = npages; in rdma_user_mmap_entry_insert_range() 318 for (i = min_pgoff, j = 0; (i + j) <= max_pgoff && j != npages; ) { in rdma_user_mmap_entry_insert_range() 331 if (j != npages) in rdma_user_mmap_entry_insert_range()
|
/freebsd/sys/kern/ |
H A D | kern_sendfile.c | 92 int npages; member 421 npages = sfio->npages; in sendfile_swapin() 432 if (grabbed < npages) { in sendfile_swapin() 435 npages = grabbed; in sendfile_swapin() 439 for (i = 0; i < npages;) { in sendfile_swapin() 549 if (i + count == npages) in sendfile_swapin() 920 npages; in vn_sendfile() 925 npages, rhpages); in vn_sendfile() 933 sfio->npages = npages; in vn_sendfile() 992 sfio->npages = i; in vn_sendfile() [all …]
|
H A D | kern_physio.c | 48 int error, i, npages, maxpages; in physio() local 52 npages = 0; in physio() 152 if ((npages = vm_fault_quick_hold_pages( in physio() 162 pages, npages); in physio() 166 bp->bio_ma_n = npages; in physio() 182 pmap_qremove((vm_offset_t)sa, npages); in physio() 183 vm_page_unhold_pages(pages, npages); in physio()
|
/freebsd/sys/dev/mthca/ |
H A D | mthca_memfree.c | 71 for (i = 0; i < chunk->npages; ++i) in mthca_free_icm_pages() 156 while (npages > 0) { in mthca_alloc_icm() 164 chunk->npages = 0; in mthca_alloc_icm() 169 while (1 << cur_order > npages) in mthca_alloc_icm() 181 ++chunk->npages; in mthca_alloc_icm() 187 chunk->npages, in mthca_alloc_icm() 197 npages -= 1 << cur_order; in mthca_alloc_icm() 207 chunk->npages, in mthca_alloc_icm() 524 int npages; in mthca_init_user_db_tab() local 536 for (i = 0; i < npages; ++i) { in mthca_init_user_db_tab() [all …]
|
H A D | mthca_allocator.c | 199 int npages, shift; in mthca_buf_alloc() local 206 npages = 1; in mthca_buf_alloc() 220 npages *= 2; in mthca_buf_alloc() 223 dma_list = kmalloc(npages * sizeof *dma_list, GFP_KERNEL); in mthca_buf_alloc() 227 for (i = 0; i < npages; ++i) in mthca_buf_alloc() 231 npages = (size + PAGE_SIZE - 1) / PAGE_SIZE; in mthca_buf_alloc() 234 dma_list = kmalloc(npages * sizeof *dma_list, GFP_KERNEL); in mthca_buf_alloc() 238 buf->page_list = kmalloc(npages * sizeof *buf->page_list, in mthca_buf_alloc() 243 for (i = 0; i < npages; ++i) in mthca_buf_alloc() 246 for (i = 0; i < npages; ++i) { in mthca_buf_alloc() [all …]
|
/freebsd/lib/libusbhid/ |
H A D | usage.c | 54 static int npages, npagesmax; variable 62 for (i = 0; i < npages; i++) { in dump_hid_table() 125 if (npages >= npagesmax) { in hid_init() 139 curpage = &pages[npages++]; in hid_init() 166 for (k = 0; k < npages; k++) in hid_usage_page() 181 for (k = 0; k < npages; k++) in hid_usage_in_page() 184 if (k >= npages) in hid_usage_in_page() 210 for (k = 0; k < npages; k++) in hid_parse_usage_page() 228 for (k = 0; k < npages; k++) in hid_parse_usage_in_page()
|
/freebsd/sys/dev/mlx4/mlx4_core/ |
H A D | mlx4_mr.c | 205 if (!npages) { in mlx4_mtt_init() 714 for (i = 0; i < npages; ++i) in mlx4_write_mtt_chunk() 738 while (npages > 0) { in __mlx4_write_mtt() 742 npages -= chunk; in __mlx4_write_mtt() 769 while (npages > 0) { in mlx4_write_mtt() 771 npages); in mlx4_write_mtt() 783 npages -= chunk; in mlx4_write_mtt() 976 int npages, u64 iova) in mlx4_check_fmr() argument 980 if (npages > fmr->max_pages) in mlx4_check_fmr() 991 for (i = 0; i < npages; ++i) { in mlx4_check_fmr() [all …]
|
H A D | mlx4_icm.c | 63 for (i = 0; i < chunk->npages; ++i) in mlx4_free_icm_pages() 72 for (i = 0; i < chunk->npages; ++i) in mlx4_free_icm_coherent() 154 while (npages > 0) { in mlx4_alloc_icm() 169 chunk->npages = 0; in mlx4_alloc_icm() 174 while (1 << cur_order > npages) in mlx4_alloc_icm() 179 &chunk->mem[chunk->npages], in mlx4_alloc_icm() 193 ++chunk->npages; in mlx4_alloc_icm() 199 chunk->npages, in mlx4_alloc_icm() 209 npages -= 1 << cur_order; in mlx4_alloc_icm() 214 chunk->npages, in mlx4_alloc_icm() [all …]
|
/freebsd/sys/dev/virtio/balloon/ |
H A D | virtio_balloon.c | 340 if (npages > VTBALLOON_PAGES_PER_REQUEST) in vtballoon_inflate() 341 npages = VTBALLOON_PAGES_PER_REQUEST; in vtballoon_inflate() 343 for (i = 0; i < npages; i++) { in vtballoon_inflate() 372 if (npages > VTBALLOON_PAGES_PER_REQUEST) in vtballoon_deflate() 373 npages = VTBALLOON_PAGES_PER_REQUEST; in vtballoon_deflate() 375 for (i = 0; i < npages; i++) { in vtballoon_deflate() 406 int npages) in vtballoon_send_page_frames() argument 416 npages * sizeof(uint32_t)); in vtballoon_send_page_frames() 490 uint32_t npages; in vtballoon_update_size() local 492 npages = sc->vtballoon_current_npages; in vtballoon_update_size() [all …]
|
/freebsd/sys/arm/nvidia/drm2/ |
H A D | tegra_bo.c | 59 pmap_qremove(bo->vbase, bo->npages); in tegra_bo_destruct() 62 for (i = 0; i < bo->npages; i++) { in tegra_bo_destruct() 93 tegra_bo_alloc_contig(size_t npages, u_long alignment, vm_memattr_t memattr, in tegra_bo_alloc_contig() argument 105 m = vm_page_alloc_noobj_contig(VM_ALLOC_WIRED | VM_ALLOC_ZERO, npages, in tegra_bo_alloc_contig() 109 err = vm_page_reclaim_contig(0, npages, low, high, in tegra_bo_alloc_contig() 121 for (i = 0; i < npages; i++, m++) { in tegra_bo_alloc_contig() 144 for (i = 0; i < bo->npages; i++) { in tegra_bo_init_pager() 164 pmap_qenter(bo->vbase, bo->m, bo->npages); in tegra_bo_init_pager() 177 bo->npages = atop(size); in tegra_bo_alloc() 178 bo->m = malloc(sizeof(vm_page_t *) * bo->npages, DRM_MEM_DRIVER, in tegra_bo_alloc() [all …]
|
/freebsd/contrib/mandoc/ |
H A D | dba_read.c | 45 int32_t im, ip, iv, npages; in dba_read() local 49 npages = dbm_page_count(); in dba_read() 50 dba = dba_new(npages < 128 ? 128 : npages); in dba_read() 51 for (ip = 0; ip < npages; ip++) { in dba_read()
|
H A D | dbm.c | 69 static int32_t npages; variable 94 if ((npages = be32toh(*dbm_getint(4))) < 0) { in dbm_open() 96 fname, npages); in dbm_open() 139 return npages; in dbm_page_count() 151 assert(ip < npages); in dbm_page_get() 265 ip = npages; in page_bytitle() 273 while (ip < npages) { in page_bytitle() 289 if (ip == npages) { in page_bytitle() 303 if (++ip < npages) { in page_bytitle() 331 for ( ; ip < npages; ip++) in page_byarch()
|
/freebsd/sys/dev/mlx5/mlx5_ib/ |
H A D | mlx5_ib_mr.c | 534 int npages; in get_octo_len() local 538 return (npages + 1) / 2; in get_octo_len() 566 memset(pas + npages, 0, *size - npages * sizeof(u64)); in dma_map_mr_pas() 596 umrwr->npages = n; in prep_umr_wqe_common() 637 if (!*npages) { in mr_umem_get() 805 npages = min_t(size_t, in mlx5_ib_update_mtt() 815 memset(pas + npages, 0, size - npages * sizeof(u64)); in mlx5_ib_update_mtt() 949 mr->npages = npages; in set_mr_fileds() 965 int npages; in mlx5_ib_reg_user_mr() local 1138 int npages = 0; in mlx5_ib_rereg_user_mr() local [all …]
|
/freebsd/sys/dev/gve/ |
H A D | gve_qpl.c | 97 gve_alloc_qpl(struct gve_priv *priv, uint32_t id, int npages, bool single_kva) in gve_alloc_qpl() argument 103 if (npages + priv->num_registered_pages > priv->max_registered_pages) { in gve_alloc_qpl() 105 (uintmax_t)npages + priv->num_registered_pages, in gve_alloc_qpl() 114 qpl->dmas = malloc(npages * sizeof(*qpl->dmas), M_GVE_QPL, in gve_alloc_qpl() 117 qpl->pages = malloc(npages * sizeof(*qpl->pages), M_GVE_QPL, in gve_alloc_qpl() 122 qpl->kva = kva_alloc(PAGE_SIZE * npages); in gve_alloc_qpl() 130 for (i = 0; i < npages; i++) { in gve_alloc_qpl() 151 pmap_qenter(qpl->kva, qpl->pages, npages); in gve_alloc_qpl() 153 for (i = 0; i < npages; i++) { in gve_alloc_qpl()
|
/freebsd/sys/fs/smbfs/ |
H A D | smbfs_io.c | 444 npages = ap->a_count; in smbfs_getpages() 454 if (!vm_page_none_valid(pages[npages - 1]) && --npages == 0) in smbfs_getpages() 464 pmap_qenter(kva, pages, npages); in smbfs_getpages() 468 count = npages << PAGE_SHIFT; in smbfs_getpages() 481 pmap_qremove(kva, npages); in smbfs_getpages() 558 int i, npages, count; in smbfs_putpages() local 573 npages = btoc(count); in smbfs_putpages() 575 for (i = 0; i < npages; i++) { in smbfs_putpages() 582 pmap_qenter(kva, pages, npages); in smbfs_putpages() 605 pmap_qremove(kva, npages); in smbfs_putpages() [all …]
|
/freebsd/sys/dev/sfxge/common/ |
H A D | mcdi_mon.c | 297 __out_ecount(npages) uint32_t *sensor_maskp, in efx_mcdi_sensor_info() 298 __in size_t npages) in efx_mcdi_sensor_info() argument 308 if (npages < 1) { in efx_mcdi_sensor_info() 313 for (page = 0; page < npages; page++) { in efx_mcdi_sensor_info() 334 if ((page != (npages - 1)) && in efx_mcdi_sensor_info() 342 if (sensor_maskp[npages - 1] & (1U << MC_CMD_SENSOR_PAGE0_NEXT)) { in efx_mcdi_sensor_info() 563 uint32_t npages; in mcdi_mon_cfg_build() local 593 npages = 0; in mcdi_mon_cfg_build() 594 if ((rc = efx_mcdi_sensor_info_npages(enp, &npages)) != 0) in mcdi_mon_cfg_build() 598 encp->enc_mcdi_sensor_mask_size = npages * sizeof (uint32_t); in mcdi_mon_cfg_build() [all …]
|