| /linux/drivers/iommu/iommufd/ |
| H A D | pages.c | 164 static void iopt_pages_add_npinned(struct iopt_pages *pages, size_t npages) in iopt_pages_add_npinned() argument 168 rc = check_add_overflow(pages->npinned, npages, &pages->npinned); in iopt_pages_add_npinned() 170 WARN_ON(rc || pages->npinned > pages->npages); in iopt_pages_add_npinned() 173 static void iopt_pages_sub_npinned(struct iopt_pages *pages, size_t npages) in iopt_pages_sub_npinned() argument 177 rc = check_sub_overflow(pages->npinned, npages, &pages->npinned); in iopt_pages_sub_npinned() 179 WARN_ON(rc || pages->npinned > pages->npages); in iopt_pages_sub_npinned() 182 static void iopt_pages_err_unpin(struct iopt_pages *pages, in iopt_pages_err_unpin() argument 190 iopt_pages_sub_npinned(pages, npages); in iopt_pages_err_unpin() 250 static struct iopt_area *iopt_pages_find_domain_area(struct iopt_pages *pages, in iopt_pages_find_domain_area() argument 255 node = interval_tree_iter_first(&pages->domains_itree, index, index); in iopt_pages_find_domain_area() [all …]
|
| H A D | io_pagetable.c | 24 struct iopt_pages *pages; member 43 if (!iter->area->pages) { in iopt_area_contig_init() 66 !iter->area->pages) { in iopt_area_contig_next() 208 struct iopt_pages *pages, unsigned long iova, in iopt_insert_area() argument 214 if ((iommu_prot & IOMMU_WRITE) && !pages->writable) in iopt_insert_area() 230 if (WARN_ON(area->pages_node.last >= pages->npages)) in iopt_insert_area() 280 switch (elm->pages->type) { in iopt_alloc_area_pages() 282 start = elm->start_byte + (uintptr_t)elm->pages->uptr; in iopt_alloc_area_pages() 285 start = elm->start_byte + elm->pages->start; in iopt_alloc_area_pages() 308 rc = iopt_insert_area(iopt, elm->area, elm->pages, iova, in iopt_alloc_area_pages() [all …]
|
| /linux/net/ceph/ |
| H A D | pagevec.c | 13 void ceph_put_page_vector(struct page **pages, int num_pages, bool dirty) in ceph_put_page_vector() argument 19 set_page_dirty_lock(pages[i]); in ceph_put_page_vector() 20 put_page(pages[i]); in ceph_put_page_vector() 22 kvfree(pages); in ceph_put_page_vector() 26 void ceph_release_page_vector(struct page **pages, int num_pages) in ceph_release_page_vector() argument 31 __free_pages(pages[i], 0); in ceph_release_page_vector() 32 kfree(pages); in ceph_release_page_vector() 41 struct page **pages; in ceph_alloc_page_vector() local 44 pages = kmalloc_array(num_pages, sizeof(*pages), flags); in ceph_alloc_page_vector() 45 if (!pages) in ceph_alloc_page_vector() [all …]
|
| /linux/mm/ |
| H A D | percpu-vm.c | 34 static struct page **pages; in pcpu_get_pages() local 35 size_t pages_size = pcpu_nr_units * pcpu_unit_pages * sizeof(pages[0]); in pcpu_get_pages() 39 if (!pages) in pcpu_get_pages() 40 pages = pcpu_mem_zalloc(pages_size, GFP_KERNEL); in pcpu_get_pages() 41 return pages; in pcpu_get_pages() 55 struct page **pages, int page_start, int page_end) in pcpu_free_pages() argument 62 struct page *page = pages[pcpu_page_idx(cpu, i)]; in pcpu_free_pages() 83 struct page **pages, int page_start, int page_end, in pcpu_alloc_pages() argument 93 struct page **pagep = &pages[pcpu_page_idx(cpu, i)]; in pcpu_alloc_pages() 104 __free_page(pages[pcpu_page_idx(cpu, i)]); in pcpu_alloc_pages() [all …]
|
| H A D | gup_test.c | 10 static void put_back_pages(unsigned int cmd, struct page **pages, in put_back_pages() argument 19 put_page(pages[i]); in put_back_pages() 25 unpin_user_pages(pages, nr_pages); in put_back_pages() 29 unpin_user_pages(pages, nr_pages); in put_back_pages() 32 put_page(pages[i]); in put_back_pages() 39 static void verify_dma_pinned(unsigned int cmd, struct page **pages, in verify_dma_pinned() argument 50 folio = page_folio(pages[i]); in verify_dma_pinned() 69 static void dump_pages_test(struct gup_test *gup, struct page **pages, in dump_pages_test() argument 94 dump_page(pages[index_to_dump], in dump_pages_test() 106 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/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(sizeof(*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 void *io_mem_alloc_compound(struct page **pages, int nr_pages, in io_mem_alloc_compound() argument 35 pages[i] = page + i; in io_mem_alloc_compound() 43 struct page **pages; in io_pin_pages() local 59 pages = kvmalloc_array(nr_pages, sizeof(struct page *), GFP_KERNEL); in io_pin_pages() 60 if (!pages) in io_pin_pages() 64 pages); in io_pin_pages() 68 return pages; in io_pin_pages() 75 unpin_user_pages(pages, ret); in io_pin_pages() 78 kvfree(pages); in io_pin_pages() 93 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 68 if (!pages[i]) in zisofs_uncompress_block() 70 memzero_page(pages[i], 0, PAGE_SIZE); in zisofs_uncompress_block() 71 SetPageUptodate(pages[i]); in zisofs_uncompress_block() 121 if (pages[curpage]) { in zisofs_uncompress_block() 122 stream.next_out = kmap_local_page(pages[curpage]) in zisofs_uncompress_block() 174 if (pages[curpage]) { in zisofs_uncompress_block() 175 flush_dcache_page(pages[curpage]); in zisofs_uncompress_block() 176 SetPageUptodate(pages[curpage]); in zisofs_uncompress_block() 207 struct page **pages) in zisofs_fill_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 = kcalloc(nr_pages, sizeof(pages[0]), GFP_KERNEL); in xen_xlate_map_ballooned_pages() [all …]
|
| /linux/drivers/gpu/drm/xen/ |
| H A D | xen_drm_front_gem.c | 30 struct page **pages; member 49 xen_obj->pages = kvmalloc_array(xen_obj->num_pages, in gem_alloc_pages_array() 51 return !xen_obj->pages ? -ENOMEM : 0; in gem_alloc_pages_array() 56 kvfree(xen_obj->pages); in gem_free_pages_array() 57 xen_obj->pages = NULL; in gem_free_pages_array() 93 ret = vm_map_pages(vma, xen_obj->pages, xen_obj->num_pages); in xen_drm_front_gem_object_mmap() 160 xen_obj->pages); in gem_create() 176 xen_obj->pages = drm_gem_get_pages(&xen_obj->base); in gem_create() 177 if (IS_ERR(xen_obj->pages)) { in gem_create() 178 ret = PTR_ERR(xen_obj->pages); in gem_create() [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_array(count, sizeof(struct page *), GFP_KERNEL); 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/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/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/arch/s390/hypfs/ |
| H A D | hypfs_diag.c | 56 void *diag204_get_buffer(enum diag204_format fmt, int *pages) in diag204_get_buffer() argument 59 *pages = diag204_buf_pages; in diag204_get_buffer() 63 *pages = 1; in diag204_get_buffer() 65 *pages = diag204((unsigned long)DIAG204_SUBC_RSI | in diag204_get_buffer() 67 if (*pages <= 0) in diag204_get_buffer() 70 diag204_buf = __vmalloc_node(array_size(*pages, PAGE_SIZE), in diag204_get_buffer() 75 diag204_buf_pages = *pages; in diag204_get_buffer() 96 int pages, rc; in diag204_probe() local 98 buf = diag204_get_buffer(DIAG204_INFO_EXT, &pages); in diag204_probe() 101 (unsigned long)DIAG204_INFO_EXT, pages, buf) >= 0) { in diag204_probe() [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_array(count, sizeof(*pages), GFP_KERNEL); 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/drivers/gpu/drm/i915/gem/ |
| H A D | i915_gem_pages.c | 22 struct sg_table *pages) in __i915_gem_object_set_pages() argument 39 drm_clflush_sg(pages); in __i915_gem_object_set_pages() 43 obj->mm.get_page.sg_pos = pages->sgl; in __i915_gem_object_set_pages() 45 obj->mm.get_dma_page.sg_pos = pages->sgl; in __i915_gem_object_set_pages() 48 obj->mm.pages = pages; in __i915_gem_object_set_pages() 50 obj->mm.page_sizes.phys = i915_sg_dma_sizes(pages->sgl); in __i915_gem_object_set_pages() 214 struct sg_table *pages; in __i915_gem_object_unset_pages() local 218 pages = fetch_and_zero(&obj->mm.pages); in __i915_gem_object_unset_pages() 219 if (IS_ERR_OR_NULL(pages)) in __i915_gem_object_unset_pages() 220 return pages; in __i915_gem_object_unset_pages() [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; in memtop_get_page_count() local 198 pages = READ_ONCE(memtop_pages[level - 1]); in memtop_get_page_count() 199 if (!pages) { in memtop_get_page_count() 200 rc = diag310_get_memtop_size(&pages, level); in memtop_get_page_count() 203 WRITE_ONCE(memtop_pages[level - 1], pages); in memtop_get_page_count() 205 *res = pages; in memtop_get_page_count() [all …]
|
| /linux/Documentation/admin-guide/mm/ |
| H A D | hugetlbpage.rst | 28 persistent hugetlb pages in the kernel's huge page pool. It also displays 30 and surplus huge pages in the pool of huge pages of default size. 46 is the size of the pool of huge pages. 48 is the number of huge pages in the pool that are not yet 51 is short for "reserved," and is the number of huge pages for 53 but no allocation has yet been made. Reserved huge pages 55 huge page from the pool of huge pages at fault time. 57 is short for "surplus," and is the number of huge pages in 59 maximum number of surplus huge pages is controlled by 61 Note: When the feature of freeing unused vmemmap pages associated [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/net/rds/ |
| H A D | info.c | 65 struct page **pages; member 122 iter->addr = kmap_atomic(*iter->pages); in rds_info_copy() 127 "bytes %lu\n", *iter->pages, iter->addr, in rds_info_copy() 140 iter->pages++; in rds_info_copy() 166 struct page **pages = NULL; in rds_info_getsockopt() local 190 pages = kmalloc_array(nr_pages, sizeof(struct page *), GFP_KERNEL); in rds_info_getsockopt() 191 if (!pages) { in rds_info_getsockopt() 195 ret = pin_user_pages_fast(start, nr_pages, FOLL_WRITE, pages); in rds_info_getsockopt() 214 iter.pages = pages; in rds_info_getsockopt() 237 if (pages) in rds_info_getsockopt() [all …]
|
| /linux/include/linux/ |
| H A D | balloon_compaction.h | 56 struct list_head pages; /* Pages enqueued & handled to Host */ member 66 struct list_head *pages); 68 struct list_head *pages, size_t n_req_pages); 74 INIT_LIST_HEAD(&balloon->pages); in balloon_devinfo_init() 107 list_add(&page->lru, &balloon->pages); in balloon_page_insert() 138 static inline void balloon_page_push(struct list_head *pages, struct page *page) in balloon_page_push() argument 140 list_add(&page->lru, pages); in balloon_page_push() 150 static inline struct page *balloon_page_pop(struct list_head *pages) in balloon_page_pop() argument 152 struct page *page = list_first_entry_or_null(pages, struct page, lru); in balloon_page_pop()
|
| /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/arm64/include/asm/ |
| H A D | tlbflush.h | 177 #define __TLBI_RANGE_NUM(pages, scale) \ argument 179 int __pages = min((pages), \ 379 #define __flush_tlb_range_op(op, start, pages, stride, \ argument 383 typeof(pages) __flush_pages = pages; \ 416 #define __flush_s2_tlb_range_op(op, start, pages, stride, tlb_level) \ argument 417 __flush_tlb_range_op(op, start, pages, stride, 0, tlb_level, false, kvm_lpa2_is_enabled()); 420 unsigned long end, unsigned long pages, unsigned long stride) in __flush_tlb_range_limit_excess() argument 430 pages > MAX_TLBI_RANGE_PAGES) in __flush_tlb_range_limit_excess() 441 unsigned long asid, pages; in __flush_tlb_range_nosync() local 445 pages = (end - start) >> PAGE_SHIFT; in __flush_tlb_range_nosync() [all …]
|
| /linux/Documentation/mm/ |
| H A D | vmemmap_dedup.rst | 17 HugeTLB pages consist of multiple base page size pages and is supported by many 19 details. On the x86-64 architecture, HugeTLB pages of size 2MB and 1GB are 21 consists of 512 base pages and a 1GB HugeTLB page consists of 262144 base pages. 27 is the compound_head field, and this field is the same for all tail pages. 29 By removing redundant ``struct page`` for HugeTLB pages, memory can be returned 32 Different architectures support different HugeTLB pages. For example, the 34 architectures. Because arm64 supports 4k, 16k, and 64k base pages and 51 structs which size is (unit: pages):: 74 = 8 (pages) 89 = PAGE_SIZE / 8 * 8 (pages) [all …]
|