Home
last modified time | relevance | path

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

/linux/arch/xtensa/mm/
H A Dmmu.c24 static void * __init init_pmd(unsigned long vaddr, unsigned long n_pages) in init_pmd() argument
30 n_pages = ALIGN(n_pages, PTRS_PER_PTE); in init_pmd()
33 __func__, vaddr, n_pages); in init_pmd()
35 pte = memblock_alloc_low(n_pages * sizeof(pte_t), PAGE_SIZE); in init_pmd()
38 __func__, n_pages * sizeof(pte_t), PAGE_SIZE); in init_pmd()
40 for (i = 0; i < n_pages; ++i) in init_pmd()
43 for (i = 0; i < n_pages; i += PTRS_PER_PTE, ++pmd) { in init_pmd()
H A Dkasan_init.c37 unsigned long n_pages = (end - start) / PAGE_SIZE; in populate() local
38 unsigned long n_pmds = n_pages / PTRS_PER_PTE; in populate()
42 pte_t *pte = memblock_alloc_or_panic(n_pages * sizeof(pte_t), PAGE_SIZE); in populate()
/linux/mm/
H A Dballoon_compaction.c46 size_t n_pages = 0; in balloon_page_list_enqueue() local
52 n_pages++; in balloon_page_list_enqueue()
55 return n_pages; in balloon_page_list_enqueue()
82 size_t n_pages = 0; in balloon_page_list_dequeue() local
86 if (n_pages == n_req_pages) in balloon_page_list_dequeue()
103 n_pages++; in balloon_page_list_dequeue()
107 return n_pages; in balloon_page_list_dequeue()
178 int n_pages; in balloon_page_dequeue() local
180 n_pages = balloon_page_list_dequeue(b_dev_info, &pages, 1); in balloon_page_dequeue()
182 if (n_pages != 1) { in balloon_page_dequeue()
/linux/drivers/xen/
H A Dgrant-dma-ops.c83 unsigned int i, n_pages = XEN_PFN_UP(size); in xen_grant_dma_alloc() local
95 ret = alloc_pages_exact(n_pages * XEN_PAGE_SIZE, gfp); in xen_grant_dma_alloc()
101 if (gnttab_alloc_grant_reference_seq(n_pages, &grant)) { in xen_grant_dma_alloc()
102 free_pages_exact(ret, n_pages * XEN_PAGE_SIZE); in xen_grant_dma_alloc()
106 for (i = 0; i < n_pages; i++) { in xen_grant_dma_alloc()
120 unsigned int i, n_pages = XEN_PFN_UP(size); in xen_grant_dma_free() local
132 for (i = 0; i < n_pages; i++) { in xen_grant_dma_free()
140 gnttab_free_grant_reference_seq(grant, n_pages); in xen_grant_dma_free()
142 free_pages_exact(vaddr, n_pages * XEN_PAGE_SIZE); in xen_grant_dma_free()
175 unsigned int i, n_pages = XEN_PFN_UP(dma_offset + size); in xen_grant_dma_map_phys() local
[all …]
H A Dprivcmd-buf.c34 unsigned int n_pages; member
60 for (i = 0; i < vma_priv->n_pages; i++) in privcmd_buf_vmapriv_free()
152 vma_priv->n_pages++; in privcmd_buf_mmap()
166 if (vma_priv->n_pages != count) in privcmd_buf_mmap()
170 vma_priv->n_pages); in privcmd_buf_mmap()
H A Dballoon.c548 long n_pages; in balloon_thread() local
550 n_pages = min(-credit, si_mem_available()); in balloon_thread()
551 balloon_state = decrease_reservation(n_pages, in balloon_thread()
553 if (balloon_state == BP_DONE && n_pages != -credit && in balloon_thread()
554 n_pages < totalreserve_pages) in balloon_thread()
/linux/drivers/misc/
H A Dvmw_balloon.c244 unsigned int n_pages; member
690 ctl->n_pages = i; in vmballoon_alloc_page_list()
692 return req_n_pages == ctl->n_pages ? 0 : -ENOMEM; in vmballoon_alloc_page_list()
850 num_pages = ctl->n_pages; in vmballoon_lock()
861 batch_status = vmballoon_lock_op(b, ctl->n_pages, ctl->page_size, in vmballoon_lock()
891 ctl->n_pages--; in vmballoon_lock()
910 int *n_pages, in vmballoon_release_page_list() argument
920 if (n_pages) in vmballoon_release_page_list()
921 *n_pages = 0; in vmballoon_release_page_list()
987 unsigned int *n_pages, in vmballoon_enqueue_page_list() argument
[all …]
/linux/drivers/comedi/
H A Dcomedi_buf.c30 for (i = 0; i < bm->n_pages; i++) { in comedi_buf_map_kref_release()
37 for (i = 0; i < bm->n_pages; i++) { in comedi_buf_map_kref_release()
67 unsigned int n_pages) in comedi_buf_map_alloc() argument
84 bm->page_list = vzalloc(sizeof(*buf) * n_pages); in comedi_buf_map_alloc()
89 for (i = 0; i < n_pages; i++) { in comedi_buf_map_alloc()
98 for (i = 0; i < n_pages; i++) { in comedi_buf_map_alloc()
107 bm->n_pages = i; in comedi_buf_map_alloc()
108 if (i < n_pages) in comedi_buf_map_alloc()
120 unsigned int n_pages) in __comedi_buf_alloc() argument
132 bm = comedi_buf_map_alloc(dev, s->async_dma_dir, n_pages); in __comedi_buf_alloc()
[all …]
H A Dcomedi_fops.c2433 int n_pages; in comedi_mmap() local
2483 n_pages = vma_pages(vma); in comedi_mmap()
2487 if (!bm || n_pages > bm->n_pages) { in comedi_mmap()
2499 for (i = 0; i < n_pages; ++i) { in comedi_mmap()
2514 for (i = 0; i < n_pages; ++i) { in comedi_mmap()
2614 if (page == bm->n_pages) in comedi_buf_copy_to_user()
2642 if (page == bm->n_pages) in comedi_buf_copy_from_user()
/linux/drivers/media/common/videobuf2/
H A Dvideobuf2-vmalloc.c78 int n_pages, offset, i; in vb2_vmalloc_get_userptr() local
96 n_pages = frame_vector_count(vec); in vb2_vmalloc_get_userptr()
104 for (i = 1; i < n_pages; i++) in vb2_vmalloc_get_userptr()
110 buf->vaddr = vm_map_ram(frame_vector_pages(vec), n_pages, -1); in vb2_vmalloc_get_userptr()
132 unsigned int n_pages; in vb2_vmalloc_put_userptr() local
135 n_pages = frame_vector_count(buf->vec); in vb2_vmalloc_put_userptr()
137 vm_unmap_ram((void *)vaddr, n_pages); in vb2_vmalloc_put_userptr()
142 for (i = 0; i < n_pages; i++) in vb2_vmalloc_put_userptr()
/linux/kernel/
H A Drelay.c61 static struct page **relay_alloc_page_array(unsigned int n_pages) in relay_alloc_page_array() argument
63 return kvcalloc(n_pages, sizeof(struct page *), GFP_KERNEL); in relay_alloc_page_array()
112 unsigned int i, j, n_pages; in relay_alloc_buf() local
115 n_pages = *size >> PAGE_SHIFT; in relay_alloc_buf()
117 buf->page_array = relay_alloc_page_array(n_pages); in relay_alloc_buf()
121 for (i = 0; i < n_pages; i++) { in relay_alloc_buf()
127 mem = vmap(buf->page_array, n_pages, VM_MAP, PAGE_KERNEL); in relay_alloc_buf()
131 buf->page_count = n_pages; in relay_alloc_buf()
/linux/drivers/usb/host/
H A Dxhci-sideband.c22 unsigned int n_pages; in xhci_ring_to_sgtable() local
30 n_pages = PAGE_ALIGN(sz) >> PAGE_SHIFT; in xhci_ring_to_sgtable()
31 pages = kvmalloc_array(n_pages, sizeof(struct page *), GFP_KERNEL); in xhci_ring_to_sgtable()
58 if (sg_alloc_table_from_pages(sgt, pages, n_pages, 0, sz, GFP_KERNEL)) in xhci_ring_to_sgtable()
/linux/kernel/trace/
H A Dtracing_map.c294 for (i = 0; i < a->n_pages; i++) in tracing_map_array_clear()
308 for (i = 0; i < a->n_pages; i++) { in tracing_map_array_free()
333 a->n_pages = n_elts / a->entries_per_page; in tracing_map_array_alloc()
334 if (!a->n_pages) in tracing_map_array_alloc()
335 a->n_pages = 1; in tracing_map_array_alloc()
339 a->pages = kcalloc(a->n_pages, sizeof(void *), GFP_KERNEL); in tracing_map_array_alloc()
343 for (i = 0; i < a->n_pages; i++) { in tracing_map_array_alloc()
H A Dtracing_map.h169 unsigned int n_pages; member
/linux/include/linux/
H A Dscatterlist.h464 struct page **pages, unsigned int n_pages,
469 unsigned int n_pages, unsigned int offset,
495 unsigned int n_pages, in sg_alloc_table_from_pages() argument
499 return sg_alloc_table_from_pages_segment(sgt, pages, n_pages, offset, in sg_alloc_table_from_pages()
/linux/lib/
H A Dscatterlist.c433 struct page **pages, unsigned int n_pages, unsigned int offset, in sg_alloc_append_table_from_pages() argument
464 while (n_pages && pages_are_mergeable(pages[0], last_pg)) { in sg_alloc_append_table_from_pages()
470 n_pages--; in sg_alloc_append_table_from_pages()
472 if (!n_pages) in sg_alloc_append_table_from_pages()
480 for (i = 1; i < n_pages; i++) { in sg_alloc_append_table_from_pages()
496 for (j = cur_page + 1; j < n_pages; j++) { in sg_alloc_append_table_from_pages()
557 unsigned int n_pages, unsigned int offset, in sg_alloc_table_from_pages_segment() argument
564 err = sg_alloc_append_table_from_pages(&append, pages, n_pages, offset, in sg_alloc_table_from_pages_segment()
/linux/kernel/module/
H A Ddecompress.c296 unsigned int n_pages; in module_decompress() local
308 n_pages = DIV_ROUND_UP(size, PAGE_SIZE) * 2; in module_decompress()
309 error = module_extend_max_pages(info, n_pages); in module_decompress()
/linux/drivers/net/ethernet/sfc/siena/
H A Dmcdi_mon.c309 unsigned int n_pages, n_sensors, n_attrs, page; in efx_siena_mcdi_mon_probe() local
333 n_pages = page; in efx_siena_mcdi_mon_probe()
378 if (page == n_pages) in efx_siena_mcdi_mon_probe()
/linux/drivers/net/ethernet/sfc/
H A Dmcdi_mon.c309 unsigned int n_pages, n_sensors, n_attrs, page; in efx_mcdi_mon_probe() local
332 n_pages = page; in efx_mcdi_mon_probe()
378 if (page == n_pages) in efx_mcdi_mon_probe()
/linux/drivers/media/pci/intel/ipu6/
H A Dipu6-mmu.c416 unsigned int n_pages = PFN_UP(IPU6_MMUV2_TRASH_RANGE); in allocate_trash_buffer() local
424 iova = alloc_iova(&mmu->dmap->iovad, n_pages, in allocate_trash_buffer()
446 for (i = 0; i < n_pages; i++) { in allocate_trash_buffer()
/linux/include/linux/comedi/
H A Dcomedidev.h248 unsigned int n_pages; member
/linux/fs/proc/
H A Dtask_mmu.c2640 unsigned long n_pages, total_pages; in pagemap_scan_output() local
2648 n_pages = (*end - addr) / PAGE_SIZE; in pagemap_scan_output()
2649 if (check_add_overflow(p->found_pages, n_pages, &total_pages) || in pagemap_scan_output()
2653 n_pages -= n_too_much; in pagemap_scan_output()
2659 n_pages = 0; in pagemap_scan_output()
2663 p->found_pages += n_pages; in pagemap_scan_output()
/linux/drivers/net/ethernet/mediatek/
H A Dmtk_wed.c644 int i, page_idx = 0, n_pages, ring_size; in mtk_wed_tx_buffer_alloc() local
657 n_pages = dev->tx_buf_ring.size / MTK_WED_BUF_PER_PAGE; in mtk_wed_tx_buffer_alloc()
659 page_list = kcalloc(n_pages, sizeof(*page_list), GFP_KERNEL); in mtk_wed_tx_buffer_alloc()
774 int n_pages = MTK_WED_RX_PG_BM_CNT / MTK_WED_RX_BUF_PER_PAGE; in mtk_wed_hwrro_buffer_alloc() local
783 page_list = kcalloc(n_pages, sizeof(*page_list), GFP_KERNEL); in mtk_wed_hwrro_buffer_alloc()
/linux/drivers/usb/gadget/function/
H A Df_fs.c808 unsigned int n_pages; in ffs_build_sg_list() local
815 n_pages = PAGE_ALIGN(sz) >> PAGE_SHIFT; in ffs_build_sg_list()
816 pages = kvmalloc_array(n_pages, sizeof(struct page *), GFP_KERNEL); in ffs_build_sg_list()
822 for (i = 0, ptr = vaddr; i < n_pages; ++i, ptr += PAGE_SIZE) in ffs_build_sg_list()
825 if (sg_alloc_table_from_pages(sgt, pages, n_pages, 0, sz, GFP_KERNEL)) { in ffs_build_sg_list()
/linux/drivers/md/
H A Ddm-integrity.c4227 static struct page_list *dm_integrity_alloc_page_list(unsigned int n_pages) in dm_integrity_alloc_page_list() argument
4232 pl = kvmalloc_array(n_pages + 1, sizeof(struct page_list), GFP_KERNEL | __GFP_ZERO); in dm_integrity_alloc_page_list()
4236 for (i = 0; i < n_pages; i++) { in dm_integrity_alloc_page_list()
4276 unsigned int n_pages; in dm_integrity_alloc_journal_scatterlist() local
4283 n_pages = (end_index - start_index + 1); in dm_integrity_alloc_journal_scatterlist()
4285 s = kvmalloc_array(n_pages, sizeof(struct scatterlist), in dm_integrity_alloc_journal_scatterlist()
4292 sg_init_table(s, n_pages); in dm_integrity_alloc_journal_scatterlist()