| /linux/drivers/iommu/iommufd/ |
| H A D | pages.c | 167 static void iopt_pages_add_npinned(struct iopt_pages *pages, size_t npages) in iopt_pages_add_npinned() argument 171 rc = check_add_overflow(pages->npinned, npages, &pages->npinned); in iopt_pages_add_npinned() 173 WARN_ON(rc || pages->npinned > pages->npages); in iopt_pages_add_npinned() 176 static void iopt_pages_sub_npinned(struct iopt_pages *pages, size_t npages) in iopt_pages_sub_npinned() argument 180 rc = check_sub_overflow(pages->npinned, npages, &pages->npinned); in iopt_pages_sub_npinned() 182 WARN_ON(rc || pages->npinned > pages->npages); in iopt_pages_sub_npinned() 185 static void iopt_pages_err_unpin(struct iopt_pages *pages, in iopt_pages_err_unpin() argument 193 iopt_pages_sub_npinned(pages, npages); in iopt_pages_err_unpin() 253 static struct iopt_area *iopt_pages_find_domain_area(struct iopt_pages *pages, in iopt_pages_find_domain_area() argument 258 node = interval_tree_iter_first(&pages->domains_itree, index, index); in iopt_pages_find_domain_area() [all …]
|
| /linux/net/ceph/ |
| H A D | pagevec.c | 13 void ceph_release_page_vector(struct page **pages, int num_pages) in ceph_release_page_vector() argument 18 __free_pages(pages[i], 0); in ceph_release_page_vector() 19 kfree(pages); in ceph_release_page_vector() 28 struct page **pages; in ceph_alloc_page_vector() local 31 pages = kmalloc_objs(*pages, num_pages, flags); in ceph_alloc_page_vector() 32 if (!pages) in ceph_alloc_page_vector() 35 pages[i] = __page_cache_alloc(flags); in ceph_alloc_page_vector() 36 if (pages[i] == NULL) { in ceph_alloc_page_vector() 37 ceph_release_page_vector(pages, i); in ceph_alloc_page_vector() 41 return pages; in ceph_alloc_page_vector() [all …]
|
| /linux/drivers/gpu/drm/i915/gem/selftests/ |
| H A D | huge_gem_object.c | 12 struct sg_table *pages) in huge_free_pages() argument 18 for_each_sgt_page(page, sgt_iter, pages) { in huge_free_pages() 24 sg_free_table(pages); in huge_free_pages() 25 kfree(pages); in huge_free_pages() 34 struct sg_table *pages; in huge_get_pages() local 41 pages = kmalloc_obj(*pages, GFP); in huge_get_pages() 42 if (!pages) in huge_get_pages() 45 if (sg_alloc_table(pages, npages, GFP)) { in huge_get_pages() 46 kfree(pages); in huge_get_pages() 50 sg = pages->sgl; in huge_get_pages() [all …]
|
| /linux/io_uring/ |
| H A D | memmap.c | 18 static bool io_mem_alloc_compound(struct page **pages, int nr_pages, in io_mem_alloc_compound() argument 50 pages[i] = page + i; in io_mem_alloc_compound() 58 struct page **pages; in io_pin_pages() local 74 pages = kvmalloc_objs(struct page *, nr_pages, GFP_KERNEL_ACCOUNT); in io_pin_pages() 75 if (!pages) in io_pin_pages() 79 pages); in io_pin_pages() 83 return pages; in io_pin_pages() 90 unpin_user_pages(pages, ret); in io_pin_pages() 93 kvfree(pages); in io_pin_pages() 108 if (mr->pages) { in io_free_region() [all …]
|
| /linux/fs/isofs/ |
| H A D | compress.c | 42 struct page **pages, unsigned poffset, in zisofs_uncompress_block() argument 70 if (!pages[i]) in zisofs_uncompress_block() 72 memzero_page(pages[i], off, PAGE_SIZE - off); in zisofs_uncompress_block() 73 SetPageUptodate(pages[i]); in zisofs_uncompress_block() 123 if (pages[curpage]) { in zisofs_uncompress_block() 124 stream.next_out = kmap_local_page(pages[curpage]) in zisofs_uncompress_block() 176 if (pages[curpage]) { in zisofs_uncompress_block() 177 flush_dcache_page(pages[curpage]); in zisofs_uncompress_block() 178 SetPageUptodate(pages[curpage]); in zisofs_uncompress_block() 209 struct page **pages) in zisofs_fill_pages() argument [all …]
|
| /linux/mm/ |
| H A D | gup_test.c | 17 static void put_back_pages(unsigned int cmd, struct page **pages, in put_back_pages() argument 26 put_page(pages[i]); in put_back_pages() 32 unpin_user_pages(pages, nr_pages); in put_back_pages() 36 unpin_user_pages(pages, nr_pages); in put_back_pages() 39 put_page(pages[i]); in put_back_pages() 46 static void verify_dma_pinned(unsigned int cmd, struct page **pages, in verify_dma_pinned() argument 57 folio = page_folio(pages[i]); in verify_dma_pinned() 76 static void dump_pages_test(struct gup_test *gup, struct page **pages, in dump_pages_test() argument 101 dump_page(pages[index_to_dump], in dump_pages_test() 113 struct page **pages; in __gup_test_ioctl() local [all …]
|
| H A D | gup.c | 31 static inline void sanity_check_pinned_pages(struct page **pages, in sanity_check_pinned_pages() argument 49 for (; npages; npages--, pages++) { in sanity_check_pinned_pages() 50 struct page *page = *pages; in sanity_check_pinned_pages() 284 void unpin_user_pages_dirty_lock(struct page **pages, unsigned long npages, in unpin_user_pages_dirty_lock() argument 292 unpin_user_pages(pages, npages); in unpin_user_pages_dirty_lock() 296 sanity_check_pinned_pages(pages, npages); in unpin_user_pages_dirty_lock() 298 folio = gup_folio_next(pages, npages, i, &nr); in unpin_user_pages_dirty_lock() 375 static void gup_fast_unpin_user_pages(struct page **pages, unsigned long npages) in gup_fast_unpin_user_pages() argument 387 folio = gup_folio_next(pages, npages, i, &nr); in gup_fast_unpin_user_pages() 401 void unpin_user_pages(struct page **pages, unsigned long npages) in unpin_user_pages() argument [all …]
|
| /linux/drivers/xen/ |
| H A D | xlate_mmu.c | 48 static void xen_for_each_gfn(struct page **pages, unsigned nr_gfn, in xen_for_each_gfn() argument 57 page = pages[i / XEN_PFN_PER_PAGE]; in xen_for_each_gfn() 71 struct page **pages; member 99 struct page *page = info->pages[info->index++]; in remap_pte_fn() 148 struct page **pages) in xen_xlate_remap_gfn_array() argument 163 data.pages = pages; in xen_xlate_remap_gfn_array() 184 int nr, struct page **pages) in xen_xlate_unmap_gfn_range() argument 186 xen_for_each_gfn(pages, nr, unmap_gfn, NULL); in xen_xlate_unmap_gfn_range() 217 struct page **pages; in xen_xlate_map_ballooned_pages() local 226 pages = kzalloc_objs(pages[0], nr_pages); in xen_xlate_map_ballooned_pages() [all …]
|
| /linux/kernel/dma/ |
| H A D | remap.c | 17 return area->pages; in dma_common_find_pages() 24 void *dma_common_pages_remap(struct page **pages, size_t size, in dma_common_pages_remap() argument 29 vaddr = vmap(pages, PAGE_ALIGN(size) >> PAGE_SHIFT, in dma_common_pages_remap() 32 find_vm_area(vaddr)->pages = pages; in dma_common_pages_remap() 44 struct page **pages; in dma_common_contiguous_remap() local 48 pages = kvmalloc_objs(struct page *, count); in dma_common_contiguous_remap() 49 if (!pages) in dma_common_contiguous_remap() 52 pages[i] = page++; in dma_common_contiguous_remap() 53 vaddr = vmap(pages, count, VM_DMA_COHERENT, prot); in dma_common_contiguous_remap() 54 kvfree(pages); in dma_common_contiguous_remap()
|
| /linux/drivers/staging/media/ipu7/ |
| H A D | ipu7-dma.c | 23 struct page **pages; member 62 struct page **pages; in __alloc_buffer() local 65 pages = kvzalloc(array_size, GFP_KERNEL); in __alloc_buffer() 66 if (!pages) in __alloc_buffer() 74 pages[i] = alloc_pages(gfp, order); in __alloc_buffer() 75 while (!pages[i] && order) in __alloc_buffer() 76 pages[i] = alloc_pages(gfp, --order); in __alloc_buffer() 77 if (!pages[i]) in __alloc_buffer() 81 split_page(pages[i], order); in __alloc_buffer() 84 pages[i + j] = pages[i] + j; in __alloc_buffer() [all …]
|
| /linux/drivers/media/pci/intel/ipu6/ |
| H A D | ipu6-dma.c | 23 struct page **pages; member 62 struct page **pages; in __alloc_buffer() local 65 pages = kvzalloc(array_size, GFP_KERNEL); in __alloc_buffer() 66 if (!pages) in __alloc_buffer() 74 pages[i] = alloc_pages(gfp, order); in __alloc_buffer() 75 while (!pages[i] && order) in __alloc_buffer() 76 pages[i] = alloc_pages(gfp, --order); in __alloc_buffer() 77 if (!pages[i]) in __alloc_buffer() 81 split_page(pages[i], order); in __alloc_buffer() 84 pages[i + j] = pages[i] + j; in __alloc_buffer() [all …]
|
| /linux/drivers/staging/media/ipu3/ |
| H A D | ipu3-dmamap.c | 20 static void imgu_dmamap_free_buffer(struct page **pages, in imgu_dmamap_free_buffer() argument 26 __free_page(pages[count]); in imgu_dmamap_free_buffer() 27 kvfree(pages); in imgu_dmamap_free_buffer() 36 struct page **pages; in imgu_dmamap_alloc_buffer() local 42 pages = kvmalloc_objs(*pages, count); in imgu_dmamap_alloc_buffer() 44 if (!pages) in imgu_dmamap_alloc_buffer() 72 imgu_dmamap_free_buffer(pages, i << PAGE_SHIFT); in imgu_dmamap_alloc_buffer() 77 pages[i++] = page++; in imgu_dmamap_alloc_buffer() 80 return pages; in imgu_dmamap_alloc_buffer() 100 struct page **pages; in imgu_dmamap_alloc() local [all …]
|
| /linux/arch/s390/kernel/diag/ |
| H A D | diag310.c | 110 static int diag310_get_memtop_size(unsigned long *pages, unsigned long level) in diag310_get_memtop_size() argument 118 *pages = res.result; in diag310_get_memtop_size() 129 static int diag310_store_topology_map(void *buf, unsigned long pages, unsigned long level) in diag310_store_topology_map() argument 132 union diag310_req_size req_size = { .page_count = pages }; in diag310_store_topology_map() 193 unsigned long pages, idx; in memtop_get_page_count() local 199 pages = READ_ONCE(memtop_pages[idx]); in memtop_get_page_count() 200 if (!pages) { in memtop_get_page_count() 201 rc = diag310_get_memtop_size(&pages, level); in memtop_get_page_count() 204 WRITE_ONCE(memtop_pages[idx], pages); in memtop_get_page_count() 206 *res = pages; in memtop_get_page_count() [all …]
|
| /linux/net/rds/ |
| H A D | info.c | 67 struct page **pages; member 132 iter->addr = kmap_atomic(*iter->pages); in rds_info_copy() 137 "bytes %lu\n", *iter->pages, iter->addr, in rds_info_copy() 150 iter->pages++; in rds_info_copy() 172 struct page **pages = NULL; in rds_info_getsockopt() local 208 pages = kvmalloc_objs(*pages, npages); in rds_info_getsockopt() 209 if (!pages) { in rds_info_getsockopt() 214 ret = iov_iter_extract_pages(&opt->iter_out, &pages, len, npages, in rds_info_getsockopt() 235 iter.pages = pages; in rds_info_getsockopt() 262 if (pages && iov_iter_extract_will_pin(&opt->iter_out)) in rds_info_getsockopt() [all …]
|
| /linux/drivers/media/common/videobuf2/ |
| H A D | frame_vector.c | 82 struct page **pages; in put_vaddr_frames() local 86 pages = frame_vector_pages(vec); in put_vaddr_frames() 92 if (WARN_ON(IS_ERR(pages))) in put_vaddr_frames() 95 unpin_user_pages(pages, vec->nr_frames); in put_vaddr_frames() 114 struct page **pages; in frame_vector_to_pages() local 122 pages = (struct page **)nums; in frame_vector_to_pages() 124 pages[i] = pfn_to_page(nums[i]); in frame_vector_to_pages() 140 struct page **pages; in frame_vector_to_pfns() local 144 pages = (struct page **)(vec->ptrs); in frame_vector_to_pfns() 145 nums = (unsigned long *)pages; in frame_vector_to_pfns() [all …]
|
| /linux/arch/arm64/include/asm/ |
| H A D | tlbflush.h | 234 #define __TLBI_RANGE_NUM(pages, scale) \ argument 235 (((pages) >> (5 * (scale) + 1)) - 1) 491 u64 start, size_t pages, in __flush_tlb_range_op() argument 495 u64 addr = start, end = start + pages * PAGE_SIZE; in __flush_tlb_range_op() 501 pages = (end - addr) >> PAGE_SHIFT; in __flush_tlb_range_op() 503 if (!system_supports_tlb_range() || pages == 1) in __flush_tlb_range_op() 509 num = __TLBI_RANGE_NUM(pages, scale); in __flush_tlb_range_op() 523 #define __flush_s1_tlb_range_op(op, start, pages, stride, asid, tlb_level) \ argument 524 __flush_tlb_range_op(op, r##op, start, pages, stride, asid, tlb_level, lpa2_is_enabled()) 526 #define __flush_s2_tlb_range_op(op, start, pages, stride, tlb_level) \ argument [all …]
|
| /linux/fs/ntfs/ |
| H A D | compress.c | 501 struct page **pages; in ntfs_read_compressed_block() local 517 pages = kmalloc_objs(struct page *, nr_pages, GFP_NOFS); in ntfs_read_compressed_block() 520 if (unlikely(!pages || !completed_pages)) { in ntfs_read_compressed_block() 521 kfree(pages); in ntfs_read_compressed_block() 534 pages[xpage] = page; in ntfs_read_compressed_block() 547 kfree(pages); in ntfs_read_compressed_block() 560 pages[i] = grab_cache_page_nowait(mapping, offset); in ntfs_read_compressed_block() 561 page = pages[i]; in ntfs_read_compressed_block() 573 pages[i] = NULL; in ntfs_read_compressed_block() 691 page = pages[cur_page]; in ntfs_read_compressed_block() [all …]
|
| /linux/Documentation/arch/powerpc/ |
| H A D | vmemmap_dedup.rst | 14 With 2M PMD level mapping, we require 32 struct pages and a single 64K vmemmap 15 page can contain 1024 struct pages (64K/sizeof(struct page)). Hence there is no 18 With 1G PUD level mapping, we require 16384 struct pages and a single 64K 19 vmemmap page can contain 1024 struct pages (64K/sizeof(struct page)). Hence we 20 require 16 64K pages in vmemmap to map the struct page for 1G PUD level mapping. 46 With 4K page size, 2M PMD level mapping requires 512 struct pages and a single 47 4K vmemmap page contains 64 struct pages(4K/sizeof(struct page)). Hence we 48 require 8 4K pages in vmemmap to map the struct page for 2M pmd level mapping. 74 With 1G PUD level mapping, we require 262144 struct pages and a single 4K 75 vmemmap page can contain 64 struct pages (4K/sizeof(struct page)). Hence we [all …]
|
| /linux/arch/m68k/mm/ |
| H A D | sun3kmap.c | 47 unsigned long type, int pages) in do_pmeg_mapin() argument 53 while(pages) { in do_pmeg_mapin() 57 pages--; in do_pmeg_mapin() 66 int pages; in sun3_ioremap() local 85 pages = size / PAGE_SIZE; in sun3_ioremap() 89 while(pages) { in sun3_ioremap() 93 if(seg_pages > pages) in sun3_ioremap() 94 seg_pages = pages; in sun3_ioremap() 98 pages -= seg_pages; in sun3_ioremap()
|
| /linux/drivers/net/ethernet/huawei/hinic3/ |
| H A D | hinic3_queue_common.c | 16 qpages->pages = NULL; in hinic3_queue_pages_init() 29 qpages->pages + pg_cnt); in __queue_pages_free() 31 kfree(qpages->pages); in __queue_pages_free() 32 qpages->pages = NULL; in __queue_pages_free() 47 qpages->pages = kzalloc_objs(qpages->pages[0], qpages->num_pages); in hinic3_queue_pages_alloc() 48 if (!qpages->pages) in hinic3_queue_pages_alloc() 59 qpages->pages + pg_idx); in hinic3_queue_pages_alloc()
|
| /linux/drivers/net/ethernet/amd/xgbe/ |
| H A D | xgbe-desc.c | 32 if (ring->rx_hdr_pa.pages) { in xgbe_free_ring() 35 put_page(ring->rx_hdr_pa.pages); in xgbe_free_ring() 37 ring->rx_hdr_pa.pages = NULL; in xgbe_free_ring() 43 if (ring->rx_buf_pa.pages) { in xgbe_free_ring() 46 put_page(ring->rx_buf_pa.pages); in xgbe_free_ring() 48 ring->rx_buf_pa.pages = NULL; in xgbe_free_ring() 180 struct page *pages = NULL; in xgbe_alloc_pages() local 191 pages = alloc_pages_node(node, gfp, order); in xgbe_alloc_pages() 192 if (pages) in xgbe_alloc_pages() 199 if (!pages && (node != NUMA_NO_NODE)) { in xgbe_alloc_pages() [all …]
|
| /linux/fs/squashfs/ |
| H A D | page_actor.c | 32 if (actor->next_page == actor->pages) in cache_next_page() 44 int pages, int length) in squashfs_page_actor_init() argument 51 actor->length = length ? : pages * PAGE_SIZE; in squashfs_page_actor_init() 53 actor->pages = pages; in squashfs_page_actor_init() 75 if ((actor->next_page == actor->pages) || in handle_next_page() 111 struct page **page, int pages, int length, loff_t start_index) in squashfs_page_actor_init_special() argument 128 actor->length = length ? : pages * PAGE_SIZE; in squashfs_page_actor_init_special() 130 actor->pages = pages; in squashfs_page_actor_init_special()
|
| /linux/include/xen/ |
| H A D | mem-reservation.h | 30 struct page **pages, 34 struct page **pages); 38 struct page **pages, in xenmem_reservation_va_mapping_update() argument 43 __xenmem_reservation_va_mapping_update(count, pages, frames); in xenmem_reservation_va_mapping_update() 48 struct page **pages) in xenmem_reservation_va_mapping_reset() argument 52 __xenmem_reservation_va_mapping_reset(count, pages); in xenmem_reservation_va_mapping_reset()
|
| /linux/Documentation/admin-guide/mm/ |
| H A D | zswap.rst | 8 Zswap is a lightweight compressed cache for swap pages. It takes pages that are 26 Zswap evicts pages from compressed cache on an LRU basis to the backing swap 40 When zswap is disabled at runtime it will stop storing pages that are 42 back into memory all of the pages stored in the compressed pool. The 43 pages stored in zswap will remain in the compressed pool until they are 45 pages out of the compressed pool, a swapoff on the swap device(s) will 46 fault back into memory all swapped out pages, including those in the 52 Zswap receives pages for compression from the swap subsystem and is able to 53 evict pages from its own compressed pool on an LRU basis and write them back to 60 pages are freed. The pool is not preallocated. [all …]
|
| /linux/drivers/net/ethernet/synopsys/ |
| H A D | dwc-xlgmac-desc.c | 41 if (desc_data->rx.hdr.pa.pages) in xlgmac_unmap_desc_data() 42 put_page(desc_data->rx.hdr.pa.pages); in xlgmac_unmap_desc_data() 44 if (desc_data->rx.hdr.pa_unmap.pages) { in xlgmac_unmap_desc_data() 48 put_page(desc_data->rx.hdr.pa_unmap.pages); in xlgmac_unmap_desc_data() 51 if (desc_data->rx.buf.pa.pages) in xlgmac_unmap_desc_data() 52 put_page(desc_data->rx.buf.pa.pages); in xlgmac_unmap_desc_data() 54 if (desc_data->rx.buf.pa_unmap.pages) { in xlgmac_unmap_desc_data() 58 put_page(desc_data->rx.buf.pa_unmap.pages); in xlgmac_unmap_desc_data() 93 if (ring->rx_hdr_pa.pages) { in xlgmac_free_ring() 96 put_page(ring->rx_hdr_pa.pages); in xlgmac_free_ring() [all …]
|