Home
last modified time | relevance | path

Searched refs:npages (Results 1 – 25 of 114) sorted by relevance

12345

/freebsd-11-stable/contrib/netbsd-tests/sys/uvm/
HDt_uvm_physseg.c281 uvmexp.npages = 0; in setup()
487 ATF_REQUIRE_EQ(0, uvmexp.npages); in ATF_TC_BODY()
492 ATF_REQUIRE_EQ(0, uvmexp.npages); in ATF_TC_BODY()
501 , uvmexp.npages); in ATF_TC_BODY()
510 + npages3, uvmexp.npages); in ATF_TC_BODY()
554 ATF_REQUIRE_EQ(0, uvmexp.npages); /* Boot time sanity */ in ATF_TC_BODY()
579 ATF_CHECK_EQ(atop(FIVEONETWO_KILO), uvmexp.npages); in ATF_TC_BODY()
648 ATF_REQUIRE_EQ(0, uvmexp.npages); in ATF_TC_BODY()
661 ATF_REQUIRE_EQ(0, uvmexp.npages); in ATF_TC_BODY()
692 ATF_REQUIRE_EQ(0, uvmexp.npages); in ATF_TC_BODY()
[all …]
/freebsd-11-stable/sys/dev/mlx5/mlx5_core/
HDmlx5_pagealloc.c39 s32 npages; member
297 s32 *npages, int boot) in mlx5_cmd_query_pages() argument
312 *npages = MLX5_GET(query_pages_out, out, num_pages); in mlx5_cmd_query_pages()
318 static int give_pages(struct mlx5_core_dev *dev, u16 func_id, int npages, in give_pages() argument
328 inlen += npages * MLX5_FLD_SZ_BYTES(manage_pages_in, pas[0]); in give_pages()
336 for (i = 0; i < npages; i++) { in give_pages()
346 MLX5_SET(manage_pages_in, in, input_num_entries, npages); in give_pages()
351 func_id, npages, err); in give_pages()
354 dev->priv.fw_pages += npages; in give_pages()
355 dev->priv.pages_per_func[func_id] += npages; in give_pages()
[all …]
HDmlx5_alloc.c77 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()
258 for (i = 0; i != buf->npages; i++) in mlx5_fill_page_array()
/freebsd-11-stable/sys/dev/drm2/ttm/
HDttm_page_alloc.c72 unsigned npages; member
329 static void ttm_pages_put(vm_page_t *pages, unsigned npages) in ttm_pages_put() argument
334 if (set_pages_array_wb(pages, npages)) in ttm_pages_put()
335 printf("[TTM] Failed to set %d pages to wb!\n", npages); in ttm_pages_put()
336 for (i = 0; i < npages; ++i) in ttm_pages_put()
343 pool->npages -= freed_pages; in ttm_pool_update_free_locked()
439 total += _manager->pools[i].npages; in ttm_pool_get_num_unused_pages()
620 && count > pool->npages) { in ttm_page_pool_fill_locked()
638 pool->npages += alloc_size; in ttm_page_pool_fill_locked()
646 pool->npages += cpages; in ttm_page_pool_fill_locked()
[all …]
/freebsd-11-stable/sys/dev/cxgb/ulp/iw_cxgb/
HDiw_cxgb_mem.c118 int npages) in iwch_reregister_mem() argument
124 if (npages > mhp->attr.pbl_size) in iwch_reregister_mem()
145 int iwch_alloc_pbl(struct iwch_mr *mhp, int npages) in iwch_alloc_pbl() argument
148 npages << 3); in iwch_alloc_pbl()
153 mhp->attr.pbl_size = npages; in iwch_alloc_pbl()
164 int iwch_write_pbl(struct iwch_mr *mhp, __be64 *pages, int npages, int offset) in iwch_write_pbl() argument
167 mhp->attr.pbl_addr + (offset << 3), npages); in iwch_write_pbl()
174 int *npages, in build_phys_page_list() argument
212 *npages = 0; in build_phys_page_list()
214 *npages += (buffer_list[i].size + in build_phys_page_list()
[all …]
/freebsd-11-stable/lib/libgeom/
HDgeom_stats.c45 static uint npages, spp; variable
54 munmap(statp, npages *pagesize); in geom_stats_close()
68 p = mmap(statp, (npages + 1) * pagesize, in geom_stats_resync()
74 npages++; in geom_stats_resync()
100 npages = 1; in geom_stats_open()
124 sp->ptr = malloc(pagesize * npages); in geom_stats_snapshot_get()
129 memset(sp->ptr, 0, pagesize * npages); /* page in, cache */ in geom_stats_snapshot_get()
131 memset(sp->ptr, 0, pagesize * npages); /* page in, cache */ in geom_stats_snapshot_get()
132 memcpy(sp->ptr, statp, pagesize * npages); in geom_stats_snapshot_get()
133 sp->pages = npages; in geom_stats_snapshot_get()
/freebsd-11-stable/sys/kern/
HDkern_sendfile.c82 int npages; member
289 for (int i = 0; i < sfio->npages; i++) in sendfile_iodone()
294 sfio->npages); in sendfile_iodone()
308 int npages, int rhpages, int flags) in sendfile_swapin() argument
323 VM_ALLOC_NORMAL | VM_ALLOC_WIRED | flags, pa, npages); in sendfile_swapin()
324 if (grabbed < npages) { in sendfile_swapin()
325 for (int i = grabbed; i < npages; i++) in sendfile_swapin()
327 npages = grabbed; in sendfile_swapin()
331 for (int i = 0; i < npages;) { in sendfile_swapin()
336 xfsize(i, npages, off, len))) { in sendfile_swapin()
[all …]
HDkern_physio.c48 int error, i, npages, maxpages; in physio() local
171 if ((npages = vm_fault_quick_hold_pages( in physio()
180 pages, npages); in physio()
184 bp->bio_ma_n = npages; in physio()
200 pmap_qremove((vm_offset_t)sa, npages); in physio()
201 vm_page_unhold_pages(pages, npages); in physio()
HDsubr_mbpool.c89 u_int npages; /* current number of pages */ member
160 for (i = 0; i < p->npages; i++) { in mbp_destroy()
203 if (p->npages == p->max_pages) { in mbp_alloc_page()
210 pg = &p->pages[p->npages]; in mbp_alloc_page()
226 t->page = p->npages; in mbp_alloc_page()
231 p->npages++; in mbp_alloc_page()
302 for (i = 0; i < p->npages; i++) { in mbp_card_free()
328 for (i = 0; i < p->npages; i++) { in mbp_count()
/freebsd-11-stable/sys/ofed/drivers/infiniband/core/
HDib_umem.c64 for_each_sg(umem->sg_head.sgl, sg, umem->npages, i) { in __ib_umem_release()
95 unsigned long npages; in ib_umem_get() local
159 npages = ib_umem_num_pages(umem); in ib_umem_get()
163 locked = npages + current->mm->pinned_vm; in ib_umem_get()
167 if (npages == 0 || npages > UINT_MAX) { in ib_umem_get()
172 ret = sg_alloc_table(&umem->sg_head, npages, GFP_KERNEL); in ib_umem_get()
182 while (npages) { in ib_umem_get()
184 min_t(unsigned long, npages, in ib_umem_get()
191 umem->npages += ret; in ib_umem_get()
193 npages -= ret; in ib_umem_get()
[all …]
/freebsd-11-stable/sys/dev/mthca/
HDmthca_memfree.c68 pci_unmap_sg(dev->pdev, chunk->mem, chunk->npages, in mthca_free_icm_pages()
71 for (i = 0; i < chunk->npages; ++i) in mthca_free_icm_pages()
80 for (i = 0; i < chunk->npages; ++i) { in mthca_free_icm_coherent()
136 struct mthca_icm *mthca_alloc_icm(struct mthca_dev *dev, int npages, in mthca_alloc_icm() argument
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()
174 &chunk->mem[chunk->npages], in mthca_alloc_icm()
177 ret = mthca_alloc_icm_pages(&chunk->mem[chunk->npages], in mthca_alloc_icm()
181 ++chunk->npages; in mthca_alloc_icm()
[all …]
HDmthca_allocator.c199 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-11-stable/sys/dev/mlx4/mlx4_core/
HDmlx4_mr.c200 int mlx4_mtt_init(struct mlx4_dev *dev, int npages, int page_shift, in mlx4_mtt_init() argument
205 if (!npages) { in mlx4_mtt_init()
212 for (mtt->order = 0, i = 1; i < npages; i <<= 1) in mlx4_mtt_init()
423 u64 iova, u64 size, u32 access, int npages, in mlx4_mr_alloc_reserved() argument
433 return mlx4_mtt_init(dev, npages, page_shift, &mr->mtt); in mlx4_mr_alloc_reserved()
533 int npages, int page_shift, struct mlx4_mr *mr) in mlx4_mr_alloc() argument
543 access, npages, page_shift, mr); in mlx4_mr_alloc()
595 u64 iova, u64 size, int npages, in mlx4_mr_rereg_mem_write() argument
600 err = mlx4_mtt_init(dev, npages, page_shift, &mr->mtt); in mlx4_mr_rereg_mem_write()
698 int start_index, int npages, u64 *page_list) in mlx4_write_mtt_chunk() argument
[all …]
HDmlx4_icm.c60 pci_unmap_sg(dev->persist->pdev, chunk->mem, chunk->npages, in mlx4_free_icm_pages()
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()
128 struct mlx4_icm *mlx4_alloc_icm(struct mlx4_dev *dev, int npages, in mlx4_alloc_icm() argument
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()
182 ret = mlx4_alloc_icm_pages(&chunk->mem[chunk->npages], in mlx4_alloc_icm()
193 ++chunk->npages; in mlx4_alloc_icm()
[all …]
/freebsd-11-stable/lib/libusbhid/
HDusage.c55 static int npages, npagesmax; variable
63 for (i = 0; i < npages; i++) { in dump_hid_table()
126 if (npages >= npagesmax) { in hid_init()
140 curpage = &pages[npages++]; in hid_init()
167 for (k = 0; k < npages; k++) in hid_usage_page()
182 for (k = 0; k < npages; k++) in hid_usage_in_page()
185 if (k >= npages) in hid_usage_in_page()
211 for (k = 0; k < npages; k++) in hid_parse_usage_page()
229 for (k = 0; k < npages; k++) in hid_parse_usage_in_page()
/freebsd-11-stable/sys/arm/nvidia/drm2/
HDtegra_bo.c62 pmap_qremove(bo->vbase, bo->npages); in tegra_bo_destruct()
65 for (i = 0; i < bo->npages; i++) { in tegra_bo_destruct()
97 tegra_bo_alloc_contig(size_t npages, u_long alignment, vm_memattr_t memattr, in tegra_bo_alloc_contig() argument
111 m = vm_page_alloc_contig(NULL, 0, pflags, npages, low, high, alignment, in tegra_bo_alloc_contig()
115 if (!vm_page_reclaim_contig(pflags, npages, low, high, in tegra_bo_alloc_contig()
124 for (i = 0; i < npages; i++, m++) { in tegra_bo_alloc_contig()
149 for (i = 0; i < bo->npages; i++) { in tegra_bo_init_pager()
169 pmap_qenter(bo->vbase, bo->m, bo->npages); in tegra_bo_init_pager()
182 bo->npages = atop(size); in tegra_bo_alloc()
183 bo->m = malloc(sizeof(vm_page_t *) * bo->npages, DRM_MEM_DRIVER, in tegra_bo_alloc()
[all …]
/freebsd-11-stable/sys/dev/mlx5/mlx5_ib/
HDmlx5_ib_mr.c158 int npages = 1 << ent->order; in add_keys() local
189 MLX5_SET(mkc, mkc, translations_octword_size, (npages + 1) / 2); in add_keys()
533 int npages; in get_octo_len() local
536 npages = ALIGN(len + offset, page_size) >> ilog2(page_size); in get_octo_len()
537 return (npages + 1) / 2; in get_octo_len()
546 int npages, int page_shift, int *size, in dma_map_mr_pas() argument
557 *size = ALIGN(sizeof(u64) * npages, MLX5_UMR_MTT_ALIGNMENT); in dma_map_mr_pas()
565 memset(pas + npages, 0, *size - npages * sizeof(u64)); in dma_map_mr_pas()
596 umrwr->npages = n; in prep_umr_wqe_common()
629 int access_flags, int *npages, in mr_umem_get() argument
[all …]
/freebsd-11-stable/sys/vm/
HDvm_phys.c174 u_long npages, vm_paddr_t low, vm_paddr_t high, u_long alignment,
601 u_long npages; in vm_phys_init() local
611 npages = 0; in vm_phys_init()
632 npages > VM_DMA32_NPAGES_THRESHOLD && in vm_phys_init()
639 npages += atop(seg->end - seg->start); in vm_phys_init()
659 npages = 0; in vm_phys_init()
664 seg->first_page = &vm_page_array[npages]; in vm_phys_init()
665 npages += atop(seg->end - seg->start); in vm_phys_init()
1091 vm_phys_free_contig(vm_page_t m, u_long npages) in vm_phys_free_contig() argument
1101 for (;; npages -= n) { in vm_phys_free_contig()
[all …]
HDsg_pager.c74 vm_pindex_t npages, pindex; in sg_pager_alloc() local
87 npages = 0; in sg_pager_alloc()
93 npages += sg->sg_segs[i].ss_len / PAGE_SIZE; in sg_pager_alloc()
102 if (pindex > npages || pindex < UOFF_TO_IDX(foff) || in sg_pager_alloc()
114 object = vm_object_allocate(OBJT_SG, npages); in sg_pager_alloc()
/freebsd-11-stable/contrib/mdocml/
HDdba_read.c43 int32_t im, ip, iv, npages; in dba_read() local
47 npages = dbm_page_count(); in dba_read()
48 dba = dba_new(npages < 128 ? 128 : npages); in dba_read()
49 for (ip = 0; ip < npages; ip++) { in dba_read()
HDdbm.c69 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-11-stable/sys/fs/smbfs/
HDsmbfs_io.c427 int i, error, nextoff, size, toff, npages, count;
452 npages = ap->a_count;
462 if (pages[npages - 1]->valid != 0 && --npages == 0)
472 pmap_qenter(kva, pages, npages);
474 PCPU_ADD(cnt.v_vnodepgsin, npages);
476 count = npages << PAGE_SHIFT;
489 pmap_qremove(kva, npages);
501 for (i = 0, toff = 0; i < npages; i++, toff = nextoff) {
573 int i, npages, count; local
588 npages = btoc(count);
[all …]
/freebsd-11-stable/sys/dev/virtio/balloon/
HDvirtio_balloon.c315 vtballoon_inflate(struct vtballoon_softc *sc, int npages) in vtballoon_inflate() argument
323 if (npages > VTBALLOON_PAGES_PER_REQUEST) in vtballoon_inflate()
324 npages = VTBALLOON_PAGES_PER_REQUEST; in vtballoon_inflate()
326 for (i = 0; i < npages; i++) { in vtballoon_inflate()
345 vtballoon_deflate(struct vtballoon_softc *sc, int npages) in vtballoon_deflate() argument
355 if (npages > VTBALLOON_PAGES_PER_REQUEST) in vtballoon_deflate()
356 npages = VTBALLOON_PAGES_PER_REQUEST; in vtballoon_deflate()
358 for (i = 0; i < npages; i++) { in vtballoon_deflate()
389 int npages) in vtballoon_send_page_frames() argument
399 npages * sizeof(uint32_t)); in vtballoon_send_page_frames()
/freebsd-11-stable/sys/dev/sfxge/common/
HDmcdi_mon.c401 __out_ecount(npages) uint32_t *sensor_maskp, in efx_mcdi_sensor_info()
402 __in size_t npages) in efx_mcdi_sensor_info() argument
412 if (npages < 1) { in efx_mcdi_sensor_info()
417 for (page = 0; page < npages; page++) { in efx_mcdi_sensor_info()
438 if ((page != (npages - 1)) && in efx_mcdi_sensor_info()
446 if (sensor_maskp[npages - 1] & (1U << MC_CMD_SENSOR_PAGE0_NEXT)) { in efx_mcdi_sensor_info()
498 uint32_t npages; in mcdi_mon_cfg_build() local
523 npages = 0; in mcdi_mon_cfg_build()
524 if ((rc = efx_mcdi_sensor_info_npages(enp, &npages)) != 0) in mcdi_mon_cfg_build()
527 encp->enc_mon_stat_dma_buf_size = npages * EFX_MON_STATS_PAGE_SIZE; in mcdi_mon_cfg_build()
[all …]
/freebsd-11-stable/sys/dev/mlx4/mlx4_ib/
HDmlx4_ib_mr.c466 int npages, u64 iova) in mlx4_ib_map_phys_fmr() argument
471 return mlx4_map_phys_fmr(dev->dev, &ifmr->mfmr, page_list, npages, iova, in mlx4_ib_map_phys_fmr()
528 if (unlikely(mr->npages == mr->max_pages)) in mlx4_set_page()
531 mr->pages[mr->npages++] = cpu_to_be64(addr | MLX4_MTT_FLAG_PRESENT); in mlx4_set_page()
542 mr->npages = 0; in mlx4_ib_map_mr_sg()
570 int npages; in mlx4_ib_reg_phys_mr() local
593 npages = 0; in mlx4_ib_reg_phys_mr()
595 npages += (buffer_list[i].size + (1ULL << shift) - 1) >> shift; in mlx4_ib_reg_phys_mr()
597 if (!npages) in mlx4_ib_reg_phys_mr()
604 pages = kzalloc(sizeof(pages[0]) * npages, GFP_KERNEL); in mlx4_ib_reg_phys_mr()
[all …]

12345