Home
last modified time | relevance | path

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

1234

/freebsd-9-stable/sys/dev/drm2/ttm/
Dttm_page_alloc.c75 unsigned npages; member
288 static void ttm_pages_put(vm_page_t *pages, unsigned npages) in ttm_pages_put() argument
293 if (set_pages_array_wb(pages, npages)) in ttm_pages_put()
294 printf("[TTM] Failed to set %d pages to wb!\n", npages); in ttm_pages_put()
295 for (i = 0; i < npages; ++i) in ttm_pages_put()
302 pool->npages -= freed_pages; in ttm_pool_update_free_locked()
398 total += _manager->pools[i].npages; in ttm_pool_get_num_unused_pages()
588 && count > pool->npages) { in ttm_page_pool_fill_locked()
606 pool->npages += alloc_size; in ttm_page_pool_fill_locked()
614 pool->npages += cpages; in ttm_page_pool_fill_locked()
[all …]
Dttm_page_alloc_dma.c381 struct page *pages[], unsigned npages) in ttm_dma_pages_put() argument
386 if (npages && !(pool->type & IS_CACHED) && in ttm_dma_pages_put()
387 set_pages_array_wb(pages, npages)) in ttm_dma_pages_put()
389 pool->dev_name, npages); in ttm_dma_pages_put()
945 unsigned count = 0, i, npages = 0; in ttm_dma_unpopulate() local
969 npages = count; in ttm_dma_unpopulate()
971 npages = pool->npages_free - _manager->options.max_size; in ttm_dma_unpopulate()
974 if (npages < NUM_PAGES_TO_ALLOC) in ttm_dma_unpopulate()
975 npages = NUM_PAGES_TO_ALLOC; in ttm_dma_unpopulate()
1000 if (npages) in ttm_dma_unpopulate()
[all …]
/freebsd-9-stable/lib/libgeom/
Dgeom_stats.c47 static uint npages, pagesize, spp; variable
56 munmap(statp, npages *pagesize); in geom_stats_close()
70 p = mmap(statp, (npages + 1) * pagesize, in geom_stats_resync()
76 npages++; in geom_stats_resync()
102 npages = 1; in geom_stats_open()
126 sp->ptr = malloc(pagesize * npages); in geom_stats_snapshot_get()
131 memset(sp->ptr, 0, pagesize * npages); /* page in, cache */ in geom_stats_snapshot_get()
133 memset(sp->ptr, 0, pagesize * npages); /* page in, cache */ in geom_stats_snapshot_get()
134 memcpy(sp->ptr, statp, pagesize * npages); in geom_stats_snapshot_get()
135 sp->pages = npages; in geom_stats_snapshot_get()
/freebsd-9-stable/sys/dev/cxgb/ulp/iw_cxgb/
Diw_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-9-stable/contrib/ofed/libmthca/src/
Dmemfree.c52 int npages; member
81 start = db_tab->npages - 1; in mthca_alloc_db()
173 int npages; in mthca_alloc_db_tab() local
176 npages = uarc_size / MTHCA_DB_REC_PAGE_SIZE; in mthca_alloc_db_tab()
178 npages * sizeof (struct mthca_db_page)); in mthca_alloc_db_tab()
182 db_tab->npages = npages; in mthca_alloc_db_tab()
184 db_tab->min_group2 = npages - 1; in mthca_alloc_db_tab()
186 for (i = 0; i < npages; ++i) in mthca_alloc_db_tab()
199 for (i = 0; i < db_tab->npages; ++i) in mthca_free_db_tab()
/freebsd-9-stable/sys/ofed/drivers/net/mlx4/
Dmr.c197 int mlx4_mtt_init(struct mlx4_dev *dev, int npages, int page_shift, in mlx4_mtt_init() argument
202 if (!npages) { in mlx4_mtt_init()
209 for (mtt->order = 0, i = 1; i < npages; i <<= 1) in mlx4_mtt_init()
215 npages, mtt->order); in mlx4_mtt_init()
299 u64 iova, u64 size, u32 access, int npages, in mlx4_mr_alloc_reserved() argument
309 return mlx4_mtt_init(dev, npages, page_shift, &mr->mtt); in mlx4_mr_alloc_reserved()
409 int npages, int page_shift, struct mlx4_mr *mr) in mlx4_mr_alloc() argument
419 access, npages, page_shift, mr); in mlx4_mr_alloc()
532 int start_index, int npages, u64 *page_list) in mlx4_write_mtt_chunk() argument
546 npages * sizeof (u64), DMA_TO_DEVICE); in mlx4_write_mtt_chunk()
[all …]
Dicm.c60 pci_unmap_sg(dev->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()
127 struct mlx4_icm *mlx4_alloc_icm(struct mlx4_dev *dev, int npages, in mlx4_alloc_icm() argument
151 while (npages > 0) { in mlx4_alloc_icm()
164 chunk->npages = 0; in mlx4_alloc_icm()
169 while (1 << cur_order > npages) in mlx4_alloc_icm()
174 &chunk->mem[chunk->npages], in mlx4_alloc_icm()
177 ret = mlx4_alloc_icm_pages(&chunk->mem[chunk->npages], in mlx4_alloc_icm()
188 ++chunk->npages; in mlx4_alloc_icm()
[all …]
/freebsd-9-stable/lib/libusbhid/
Dusage.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-9-stable/sys/ofed/drivers/infiniband/hw/mthca/
Dmthca_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 …]
Dmthca_allocator.c198 int npages, shift; in mthca_buf_alloc() local
205 npages = 1; in mthca_buf_alloc()
219 npages *= 2; in mthca_buf_alloc()
222 dma_list = kmalloc(npages * sizeof *dma_list, GFP_KERNEL); in mthca_buf_alloc()
226 for (i = 0; i < npages; ++i) in mthca_buf_alloc()
230 npages = (size + PAGE_SIZE - 1) / PAGE_SIZE; in mthca_buf_alloc()
233 dma_list = kmalloc(npages * sizeof *dma_list, GFP_KERNEL); in mthca_buf_alloc()
237 buf->page_list = kmalloc(npages * sizeof *buf->page_list, in mthca_buf_alloc()
242 for (i = 0; i < npages; ++i) in mthca_buf_alloc()
245 for (i = 0; i < npages; ++i) { in mthca_buf_alloc()
[all …]
/freebsd-9-stable/sys/ofed/drivers/infiniband/core/
Dumem.c178 unsigned long npages; in ib_umem_get() local
228 npages = PAGE_ALIGN(size + umem->offset) >> PAGE_SHIFT; in ib_umem_get()
232 locked = npages + current->mm->locked_vm; in ib_umem_get()
244 while (npages) { in ib_umem_get()
246 min_t(unsigned long, npages, in ib_umem_get()
254 npages -= ret; in ib_umem_get()
318 vm_size_t npages; in ib_umem_get()
334 npages = atop(end - start); in ib_umem_get()
335 if (npages > vm_page_max_wired) in ib_umem_get()
342 if (ptoa(npages + in ib_umem_get()
[all …]
/freebsd-9-stable/sys/dev/virtio/balloon/
Dvirtio_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-9-stable/sys/ofed/drivers/infiniband/hw/mlx4/
Dmr.c148 int *npages) in mlx4_ib_umem_write_mtt_block() argument
181 pages[*npages] = cur_start_addr + (mtt_size * k); in mlx4_ib_umem_write_mtt_block()
182 (*npages)++; in mlx4_ib_umem_write_mtt_block()
187 if (*npages == PAGE_SIZE / sizeof(u64)) { in mlx4_ib_umem_write_mtt_block()
190 *npages, pages); in mlx4_ib_umem_write_mtt_block()
194 (*start_index) += *npages; in mlx4_ib_umem_write_mtt_block()
195 *npages = 0; in mlx4_ib_umem_write_mtt_block()
214 int npages = 0; in mlx4_ib_umem_write_mtt() local
240 &npages); in mlx4_ib_umem_write_mtt()
259 &npages); in mlx4_ib_umem_write_mtt()
[all …]
/freebsd-9-stable/sys/dev/cxgbe/tom/
Dt4_ddp.c179 pages_to_nppods(int npages, int ddp_pgsz) in pages_to_nppods() argument
181 int nsegs = npages * PAGE_SIZE / ddp_pgsz; in pages_to_nppods()
634 bufcmp(struct ddp_buffer *db, vm_page_t *pages, int npages, int offset, int len) in bufcmp() argument
638 if (db == NULL || db->npages != npages || db->offset != offset || in bufcmp()
642 for (i = 0; i < npages; i++) { in bufcmp()
673 alloc_ddp_buffer(struct tom_data *td, vm_page_t *pages, int npages, int offset, in alloc_ddp_buffer() argument
687 for (i = 0; i < npages; i++) { in alloc_ddp_buffer()
689 while (i < npages - 1 && in alloc_ddp_buffer()
723 nppods = pages_to_nppods(npages, t4_ddp_pgsz[idx]); in alloc_ddp_buffer()
737 db->npages = npages; in alloc_ddp_buffer()
[all …]
/freebsd-9-stable/sys/vm/
Dsg_pager.c70 vm_pindex_t npages, pindex; in sg_pager_alloc() local
83 npages = 0; in sg_pager_alloc()
89 npages += sg->sg_segs[i].ss_len / PAGE_SIZE; in sg_pager_alloc()
98 if (pindex > npages) in sg_pager_alloc()
109 object = vm_object_allocate(OBJT_SG, npages); in sg_pager_alloc()
Dvm_phys.c747 vm_phys_free_contig(vm_page_t m, u_long npages) in vm_phys_free_contig() argument
757 for (;; npages -= n) { in vm_phys_free_contig()
768 if (npages < n) in vm_phys_free_contig()
774 for (; npages > 0; npages -= n) { in vm_phys_free_contig()
775 order = flsl(npages) - 1; in vm_phys_free_contig()
918 vm_phys_alloc_contig(u_long npages, vm_paddr_t low, vm_paddr_t high, in vm_phys_alloc_contig() argument
934 size = npages << PAGE_SHIFT; in vm_phys_alloc_contig()
942 for (order = 0; (1 << order) < npages; order++); in vm_phys_alloc_contig()
1003 for (m = m_ret; m < &m_ret[npages]; m = &m[1 << oind]) { in vm_phys_alloc_contig()
1014 npages_end = roundup2(npages, 1 << imin(oind, order)); in vm_phys_alloc_contig()
[all …]
/freebsd-9-stable/sys/kern/
Dsubr_mbpool.c88 u_int npages; /* current number of pages */ member
159 for (i = 0; i < p->npages; i++) { in mbp_destroy()
202 if (p->npages == p->max_pages) { in mbp_alloc_page()
209 pg = &p->pages[p->npages]; in mbp_alloc_page()
225 t->page = p->npages; in mbp_alloc_page()
230 p->npages++; in mbp_alloc_page()
300 for (i = 0; i < p->npages; i++) { in mbp_card_free()
326 for (i = 0; i < p->npages; i++) { in mbp_count()
/freebsd-9-stable/usr.sbin/lpr/filters/
Dlpf.c69 int npages = 1; variable
203 npages++; in main()
211 npages++; in main()
215 printf("%7.2f\t%s:%s\n", (float)npages, host, name); in main()
/freebsd-9-stable/sys/fs/smbfs/
Dsmbfs_io.c406 int i, error, nextoff, size, toff, npages, count, reqpage;
432 npages = btoc(count);
444 for (i = 0; i < npages; ++i) {
461 pmap_qenter(kva, pages, npages);
463 PCPU_ADD(cnt.v_vnodepgsin, npages);
476 pmap_qremove(kva, npages);
483 for (i = 0; i < npages; i++) {
496 for (i = 0, toff = 0; i < npages; i++, toff = nextoff) {
567 int i, npages, count; local
582 npages = btoc(count);
[all …]
/freebsd-9-stable/sys/fs/nwfs/
Dnwfs_io.c383 int i, error, nextoff, size, toff, npages, count;
410 npages = btoc(count);
412 pmap_qenter(kva, pages, npages);
425 pmap_qremove(kva, npages);
432 for (i = 0; i < npages; i++) {
445 for (i = 0, toff = 0; i < npages; i++, toff = nextoff) {
503 int i, npages, count;
517 npages = btoc(count);
519 for (i = 0; i < npages; i++) {
525 pmap_qenter(kva, pages, npages);
[all …]
/freebsd-9-stable/contrib/groff/src/libs/libdriver/
Dinput.cpp364 int npages = 0; variable
1521 if (npages <= 0) in parse_x_command()
1561 npages = 0; in do_file()
1684 if (npages <= 0) in do_file()
1708 if (npages <= 0) in do_file()
1719 if (npages <= 0) in do_file()
1727 if (npages <= 0) in do_file()
1753 if (npages <= 0) in do_file()
1760 if (npages <= 0) in do_file()
1765 if (npages > 0) in do_file()
[all …]
/freebsd-9-stable/lib/libc/db/hash/
Dhash_buf.c300 int npages; in __buf_init() local
303 npages = (nbytes + hashp->BSIZE - 1) >> hashp->BSHIFT; in __buf_init()
304 npages = MAX(npages, MIN_BUFFERS); in __buf_init()
306 hashp->nbufs = npages; in __buf_init()
/freebsd-9-stable/sys/i386/xen/
Dxen_machdep.c591 xen_create_contiguous_region(vm_page_t pages, int npages) in xen_create_contiguous_region() argument
605 PANIC_IF(ffs(npages) != fls(npages)); in xen_create_contiguous_region()
608 order = (ffs(npages) == fls(npages)) ? fls(npages) - 1 : fls(npages); in xen_create_contiguous_region()
668 xen_destroy_contiguous_region(void *addr, int npages) in xen_destroy_contiguous_region() argument
683 PANIC_IF(ffs(npages) != fls(npages)); in xen_destroy_contiguous_region()
686 order = (ffs(npages) == fls(npages)) ? fls(npages) - 1 : fls(npages); in xen_destroy_contiguous_region()
/freebsd-9-stable/lib/libc/db/mpool/
Dmpool.libtp148 buf_fids[i].npages = -1;
253 if ( buf_fids[fid].npages == -1 ) {
254 /* initialize npages field */
259 *new_pageno = buf_fids[fid].npages;
264 buf_fids[fid].npages++;
560 if ( buf_fids[fid].npages == -1 ) {
561 /* Initialize the npages field */
566 buf_fids[fid].npages = ( sbuf.st_size / BUFSIZE );
639 if ( obj->obj_id >= buf_fids[obj->file_id].npages) {
640 buf_fids[obj->file_id].npages = obj->obj_id+1;
[all …]
/freebsd-9-stable/sys/i386/i386/
Dvm86.c475 for (i = 0; i < vmc->npages; i++) in vm86_getpage()
486 for (i = 0; i < vmc->npages; i++) in vm86_addpage()
490 if (vmc->npages == VM86_PMAPSIZE) in vm86_addpage()
498 i = vmc->npages++; in vm86_addpage()
599 for (i = 0; i < vmc->npages; i++) {
612 for (i = 0; i < vmc->npages; i++) {
630 for (i = 0; i < vmc->npages; i++) in vm86_getaddr()
645 for (i = 0; i < vmc->npages; i++)

1234