Home
last modified time | relevance | path

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

12345678910>>...17

/linux-6.15/io_uring/
H A Dmemmap.c33 for (i = 0; i < nr_pages; i++) in io_mem_alloc_compound()
52 nr_pages = end - start; in io_pin_pages()
53 if (WARN_ON_ONCE(!nr_pages)) in io_pin_pages()
65 if (ret == nr_pages) { in io_pin_pages()
66 *npages = nr_pages; in io_pin_pages()
93 long nr_refs = mr->nr_pages; in io_free_region()
139 int nr_pages; in io_region_pin_pages() local
144 if (WARN_ON_ONCE(nr_pages != mr->nr_pages)) in io_region_pin_pages()
191 int nr_pages, ret; in io_create_region() local
218 mr->nr_pages = nr_pages; in io_create_region()
[all …]
/linux-6.15/include/linux/
H A Dhugetlb_cgroup.h127 extern int hugetlb_cgroup_charge_cgroup(int idx, unsigned long nr_pages,
131 extern void hugetlb_cgroup_commit_charge(int idx, unsigned long nr_pages,
137 extern void hugetlb_cgroup_uncharge_folio(int idx, unsigned long nr_pages,
142 extern void hugetlb_cgroup_uncharge_cgroup(int idx, unsigned long nr_pages,
152 unsigned long nr_pages,
162 unsigned long nr_pages, in hugetlb_cgroup_uncharge_file_region() argument
214 unsigned long nr_pages, in hugetlb_cgroup_charge_cgroup_rsvd() argument
227 hugetlb_cgroup_commit_charge_rsvd(int idx, unsigned long nr_pages, in hugetlb_cgroup_commit_charge_rsvd() argument
239 unsigned long nr_pages, in hugetlb_cgroup_uncharge_folio_rsvd() argument
244 unsigned long nr_pages, in hugetlb_cgroup_uncharge_cgroup() argument
[all …]
H A Dpage_counter.h71 void page_counter_cancel(struct page_counter *counter, unsigned long nr_pages);
72 void page_counter_charge(struct page_counter *counter, unsigned long nr_pages);
74 unsigned long nr_pages,
76 void page_counter_uncharge(struct page_counter *counter, unsigned long nr_pages);
77 void page_counter_set_min(struct page_counter *counter, unsigned long nr_pages);
78 void page_counter_set_low(struct page_counter *counter, unsigned long nr_pages);
81 unsigned long nr_pages) in page_counter_set_high() argument
83 WRITE_ONCE(counter->high, nr_pages); in page_counter_set_high()
86 int page_counter_set_max(struct page_counter *counter, unsigned long nr_pages);
88 unsigned long *nr_pages);
H A Dmemory_hotplug.h123 long nr_pages);
128 extern int online_pages(unsigned long pfn, unsigned long nr_pages,
155 extern void __remove_pages(unsigned long start_pfn, unsigned long nr_pages,
164 unsigned long nr_pages, struct mhp_params *params) in add_pages() argument
166 return __add_pages(nid, start_pfn, nr_pages, params); in add_pages()
169 int add_pages(int nid, unsigned long start_pfn, unsigned long nr_pages,
280 extern int offline_pages(unsigned long start_pfn, unsigned long nr_pages,
316 unsigned long nr_pages,
320 unsigned long nr_pages);
322 unsigned long nr_pages, struct vmem_altmap *altmap,
[all …]
H A Drmap.h425 VM_WARN_ON_ONCE(nr_pages <= 0); in __folio_rmap_sanity_checks()
439 VM_WARN_ON_FOLIO(nr_pages != HPAGE_PMD_NR, folio); in __folio_rmap_sanity_checks()
447 VM_WARN_ON_FOLIO(nr_pages != HPAGE_PUD_NR, folio); in __folio_rmap_sanity_checks()
550 const int orig_nr_pages = nr_pages; in __folio_dup_file_rmap()
564 } while (page++, --nr_pages > 0); in __folio_dup_file_rmap()
623 const int orig_nr_pages = nr_pages; in __folio_try_dup_anon_rmap()
648 for (i = 0; i < nr_pages; i++) in __folio_try_dup_anon_rmap()
665 } while (page++, --nr_pages > 0); in __folio_try_dup_anon_rmap()
911 unsigned long nr_pages; member
924 .nr_pages = folio_nr_pages(_folio), \
[all …]
/linux-6.15/mm/
H A Dmemory_hotplug.c69 return nr_pages; in memory_block_memmap_on_memory_pages()
727 unsigned long nr_pages) in resize_zone_range() argument
910 movable_pages += nr_pages; in auto_movable_can_online_movable()
920 unsigned long nr_pages) in default_kernel_zone_for_pfn() argument
1004 max_pages = nr_pages; in auto_movable_zone_for_pfn()
1047 unsigned long nr_pages) in default_zone_for_pfn() argument
1050 nr_pages); in default_zone_for_pfn()
1072 unsigned long nr_pages) in zone_for_pfn_range() argument
1091 long nr_pages) in adjust_present_page_count() argument
1198 arg.nr_pages = nr_pages; in online_pages()
[all …]
H A Dpage_counter.c61 new, nr_pages)) { in page_counter_cancel()
119 unsigned long nr_pages, in page_counter_try_charge() argument
144 atomic_long_sub(nr_pages, &c->usage); in page_counter_try_charge()
169 page_counter_cancel(c, nr_pages); in page_counter_try_charge()
184 page_counter_cancel(c, nr_pages); in page_counter_uncharge()
216 if (usage > nr_pages) in page_counter_set_max()
219 old = xchg(&counter->max, nr_pages); in page_counter_set_max()
240 WRITE_ONCE(counter->min, nr_pages); in page_counter_set_min()
257 WRITE_ONCE(counter->low, nr_pages); in page_counter_set_low()
273 unsigned long *nr_pages) in page_counter_memparse() argument
[all …]
H A Dpercpu-km.c55 const int nr_pages = pcpu_group_sizes[0] >> PAGE_SHIFT; in pcpu_create_chunk() local
65 pages = alloc_pages(gfp, order_base_2(nr_pages)); in pcpu_create_chunk()
71 for (i = 0; i < nr_pages; i++) in pcpu_create_chunk()
78 pcpu_chunk_populated(chunk, 0, nr_pages); in pcpu_create_chunk()
89 const int nr_pages = pcpu_group_sizes[0] >> PAGE_SHIFT; in pcpu_destroy_chunk() local
98 __free_pages(chunk->data, order_base_2(nr_pages)); in pcpu_destroy_chunk()
109 size_t nr_pages, alloc_pages; in pcpu_verify_alloc_info() local
117 nr_pages = (ai->groups[0].nr_units * ai->unit_size) >> PAGE_SHIFT; in pcpu_verify_alloc_info()
118 alloc_pages = roundup_pow_of_two(nr_pages); in pcpu_verify_alloc_info()
120 if (alloc_pages > nr_pages) in pcpu_verify_alloc_info()
[all …]
H A Dgup_test.c18 for (i = 0; i < nr_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()
31 for (i = 0; i < nr_pages; i++) in put_back_pages()
40 unsigned long nr_pages) in verify_dma_pinned() argument
49 for (i = 0; i < nr_pages; i++) { in verify_dma_pinned()
70 unsigned long nr_pages) in dump_pages_test() argument
114 nr_pages = gup->size / PAGE_SIZE; in __gup_test_ioctl()
177 nr_pages = i; in __gup_test_ioctl()
244 nr_pages = args.size / PAGE_SIZE; in pin_longterm_test_start()
[all …]
H A Dsparse.c180 unsigned long nr_pages) in subsection_mask_set() argument
197 pfns = min(nr_pages, PAGES_PER_SECTION in subsection_map_init()
207 nr_pages -= pfns; in subsection_map_init()
702 subsection_mask_set(map, pfn, nr_pages); in clear_subsection_map()
708 pfn, nr_pages)) in clear_subsection_map()
728 subsection_mask_set(map, pfn, nr_pages); in fill_subsection_map()
760 unsigned long type, nr_pages; in free_map_bootmem() local
766 for (i = 0; i < nr_pages; i++, page++) { in free_map_bootmem()
827 if (clear_subsection_map(pfn, nr_pages)) in section_deactivate()
884 rc = fill_subsection_map(pfn, nr_pages); in section_activate()
[all …]
H A Dhugetlb_cgroup.c197 unsigned int nr_pages; in hugetlb_cgroup_move_parent() local
211 nr_pages = folio_nr_pages(folio); in hugetlb_cgroup_move_parent()
282 nr_pages, &counter)) { in __hugetlb_cgroup_charge_cgroup()
328 usage + nr_pages); in __hugetlb_cgroup_commit_charge()
364 nr_pages); in __hugetlb_cgroup_uncharge_folio()
377 usage - nr_pages); in __hugetlb_cgroup_uncharge_folio()
402 nr_pages); in __hugetlb_cgroup_uncharge_cgroup()
434 unsigned long nr_pages, in hugetlb_cgroup_uncharge_file_region() argument
596 unsigned long nr_pages; in hugetlb_cgroup_write() local
609 nr_pages = round_down(nr_pages, pages_per_huge_page(&hstates[idx])); in hugetlb_cgroup_write()
[all …]
H A Dmmu_gather.c60 unsigned int nr_pages = 1; in tlb_flush_rmap_batch() local
64 nr_pages = encoded_nr_pages(pages[++i]); in tlb_flush_rmap_batch()
66 folio_remove_rmap_ptes(page_folio(page), page, nr_pages, in tlb_flush_rmap_batch()
104 unsigned int nr, nr_pages; in __tlb_batch_free_encoded_pages() local
125 for (nr = 0, nr_pages = 0; in __tlb_batch_free_encoded_pages()
126 nr < batch->nr && nr_pages < MAX_NR_FOLIOS_PER_FREE; in __tlb_batch_free_encoded_pages()
130 nr_pages += encoded_nr_pages(pages[++nr]); in __tlb_batch_free_encoded_pages()
132 nr_pages++; in __tlb_batch_free_encoded_pages()
175 VM_WARN_ON_ONCE(nr_pages != 1 && page_size != PAGE_SIZE); in __tlb_remove_folio_pages_size()
184 if (likely(nr_pages == 1)) { in __tlb_remove_folio_pages_size()
[all …]
H A Dcma.h82 void cma_sysfs_account_success_pages(struct cma *cma, unsigned long nr_pages);
83 void cma_sysfs_account_fail_pages(struct cma *cma, unsigned long nr_pages);
84 void cma_sysfs_account_release_pages(struct cma *cma, unsigned long nr_pages);
87 unsigned long nr_pages) {}; in cma_sysfs_account_success_pages() argument
89 unsigned long nr_pages) {}; in cma_sysfs_account_fail_pages() argument
91 unsigned long nr_pages) {}; in cma_sysfs_account_release_pages() argument
H A Dprocess_vm_access.c83 unsigned long nr_pages; in process_vm_rw_single_vec() local
90 nr_pages = (addr + len - 1) / PAGE_SIZE - addr / PAGE_SIZE + 1; in process_vm_rw_single_vec()
95 while (!rc && nr_pages && iov_iter_count(iter)) { in process_vm_rw_single_vec()
96 int pinned_pages = min_t(unsigned long, nr_pages, PVM_MAX_USER_PAGES); in process_vm_rw_single_vec()
123 nr_pages -= pinned_pages; in process_vm_rw_single_vec()
162 unsigned long nr_pages = 0; in process_vm_rw_core() local
178 nr_pages = max(nr_pages, nr_pages_iov); in process_vm_rw_core()
182 if (nr_pages == 0) in process_vm_rw_core()
185 if (nr_pages > PVM_MAX_PP_ARRAY_COUNT) { in process_vm_rw_core()
189 sizeof(struct page *)*nr_pages), in process_vm_rw_core()
H A Dmemcontrol.c139 unsigned int nr_pages; in obj_cgroup_release() local
166 if (nr_pages) in obj_cgroup_release()
1299 if (nr_pages < 0) in mem_cgroup_update_lru_size()
1310 if (nr_pages > 0) in mem_cgroup_update_lru_size()
1814 WRITE_ONCE(stock->nr_pages, stock_pages - nr_pages); in consume_stock()
1883 stock_pages = READ_ONCE(stock->nr_pages) + nr_pages; in __refill_stock()
2870 if (nr_pages) { in drain_obj_stock()
2963 if (nr_pages) in refill_obj_stock()
3002 nr_pages += 1; in obj_cgroup_charge()
4716 long nr_pages; in uncharge_folio() local
[all …]
/linux-6.15/fs/iomap/
H A Dswapfile.c19 unsigned long nr_pages; /* number of pages collected */ member
33 unsigned long nr_pages; in iomap_swapfile_add_extent() local
40 if (unlikely(isi->nr_pages >= isi->sis->max)) in iomap_swapfile_add_extent()
42 max_pages = isi->sis->max - isi->nr_pages; in iomap_swapfile_add_extent()
55 nr_pages = next_ppage - first_ppage; in iomap_swapfile_add_extent()
56 nr_pages = min(nr_pages, max_pages); in iomap_swapfile_add_extent()
72 error = add_swap_extent(isi->sis, isi->nr_pages, nr_pages, first_ppage); in iomap_swapfile_add_extent()
76 isi->nr_pages += nr_pages; in iomap_swapfile_add_extent()
185 if (isi.nr_pages == 0) { in iomap_swapfile_activate()
191 sis->max = isi.nr_pages; in iomap_swapfile_activate()
[all …]
/linux-6.15/drivers/xen/
H A Dballoon.c396 if (nr_pages > ARRAY_SIZE(frame_list)) in increase_reservation()
397 nr_pages = ARRAY_SIZE(frame_list); in increase_reservation()
400 for (i = 0; i < nr_pages; i++) { in increase_reservation()
402 nr_pages = i; in increase_reservation()
442 nr_pages = ARRAY_SIZE(frame_list); in decrease_reservation()
444 for (i = 0; i < nr_pages; i++) { in decrease_reservation()
447 nr_pages = i; in decrease_reservation()
483 BUG_ON(ret != nr_pages); in decrease_reservation()
592 if (si_mem_available() < nr_pages) in add_ballooned_pages()
618 while (pgno < nr_pages) { in xen_alloc_ballooned_pages()
[all …]
H A Dunpopulated-alloc.c34 static int fill_list(unsigned int nr_pages) in fill_list() argument
39 unsigned int i, alloc_pages = round_up(nr_pages, PAGES_PER_SECTION); in fill_list()
158 int xen_alloc_unpopulated_pages(unsigned int nr_pages, struct page **pages) in xen_alloc_unpopulated_pages() argument
169 return xen_alloc_ballooned_pages(nr_pages, pages); in xen_alloc_unpopulated_pages()
172 if (list_count < nr_pages) { in xen_alloc_unpopulated_pages()
173 ret = fill_list(nr_pages - list_count); in xen_alloc_unpopulated_pages()
178 for (i = 0; i < nr_pages; i++) { in xen_alloc_unpopulated_pages()
214 void xen_free_unpopulated_pages(unsigned int nr_pages, struct page **pages) in xen_free_unpopulated_pages() argument
219 xen_free_ballooned_pages(nr_pages, pages); in xen_free_unpopulated_pages()
224 for (i = 0; i < nr_pages; i++) { in xen_free_unpopulated_pages()
/linux-6.15/arch/arm64/kvm/hyp/nvhe/
H A Dsetup.c37 unsigned long nr_pages; in divide_memory_pool() local
42 vmemmap_base = hyp_early_alloc_contig(nr_pages); in divide_memory_pool()
46 nr_pages = hyp_vm_table_pages(); in divide_memory_pool()
47 vm_table_base = hyp_early_alloc_contig(nr_pages); in divide_memory_pool()
51 nr_pages = hyp_s1_pgtable_pages(); in divide_memory_pool()
52 hyp_pgt_base = hyp_early_alloc_contig(nr_pages); in divide_memory_pool()
56 nr_pages = host_s2_pgtable_pages(); in divide_memory_pool()
61 nr_pages = hyp_ffa_proxy_pages(); in divide_memory_pool()
62 ffa_proxy_pages = hyp_early_alloc_contig(nr_pages); in divide_memory_pool()
265 unsigned long nr_pages, reserved_pages, pfn; in __pkvm_init_finalise() local
[all …]
/linux-6.15/include/xen/
H A Dxen.h65 int xen_alloc_unpopulated_pages(unsigned int nr_pages, struct page **pages);
66 void xen_free_unpopulated_pages(unsigned int nr_pages, struct page **pages);
71 static inline int xen_alloc_unpopulated_pages(unsigned int nr_pages, in xen_alloc_unpopulated_pages() argument
74 return xen_alloc_ballooned_pages(nr_pages, pages); in xen_alloc_unpopulated_pages()
76 static inline void xen_free_unpopulated_pages(unsigned int nr_pages, in xen_free_unpopulated_pages() argument
79 xen_free_ballooned_pages(nr_pages, pages); in xen_free_unpopulated_pages()
/linux-6.15/drivers/firmware/efi/libstub/
H A Drelocate.c28 unsigned long nr_pages; in efi_low_alloc_above() local
45 nr_pages = size / EFI_PAGE_SIZE; in efi_low_alloc_above()
63 if (desc->num_pages < nr_pages) in efi_low_alloc_above()
77 EFI_LOADER_DATA, nr_pages, &start); in efi_low_alloc_above()
121 unsigned long nr_pages; in efi_relocate_kernel() local
139 nr_pages = round_up(alloc_size, EFI_ALLOC_ALIGN) / EFI_PAGE_SIZE; in efi_relocate_kernel()
141 EFI_LOADER_DATA, nr_pages, &efi_addr); in efi_relocate_kernel()
/linux-6.15/net/rds/
H A Dinfo.c163 unsigned long nr_pages = 0; in rds_info_getsockopt() local
187 nr_pages = (PAGE_ALIGN(start + len) - (start & PAGE_MASK)) in rds_info_getsockopt()
190 pages = kmalloc_array(nr_pages, sizeof(struct page *), GFP_KERNEL); in rds_info_getsockopt()
195 ret = pin_user_pages_fast(start, nr_pages, FOLL_WRITE, pages); in rds_info_getsockopt()
196 if (ret != nr_pages) { in rds_info_getsockopt()
198 nr_pages = ret; in rds_info_getsockopt()
200 nr_pages = 0; in rds_info_getsockopt()
205 rdsdebug("len %d nr_pages %lu\n", len, nr_pages); in rds_info_getsockopt()
238 unpin_user_pages(pages, nr_pages); in rds_info_getsockopt()
/linux-6.15/mm/kasan/
H A Dshadow.c226 if (WARN_ON(mem_data->nr_pages % KASAN_GRANULE_SIZE) || in kasan_mem_notifier()
330 for (i = 0; i < nr_pages; i++) { in ___free_pages_bulk()
340 unsigned long nr_populated, nr_total = nr_pages; in ___alloc_pages_bulk()
343 while (nr_pages) { in ___alloc_pages_bulk()
346 ___free_pages_bulk(page_array, nr_total - nr_pages); in ___alloc_pages_bulk()
350 nr_pages -= nr_populated; in ___alloc_pages_bulk()
358 unsigned long nr_pages, nr_total = PFN_UP(end - start); in __kasan_populate_vmalloc() local
368 ret = ___alloc_pages_bulk(data.pages, nr_pages); in __kasan_populate_vmalloc()
375 ___free_pages_bulk(data.pages, nr_pages); in __kasan_populate_vmalloc()
379 start += nr_pages * PAGE_SIZE; in __kasan_populate_vmalloc()
[all …]
/linux-6.15/kernel/events/
H A Dring_buffer.c179 if (rb->nr_pages) { in __perf_output_begin()
339 if (!rb->nr_pages) in ring_buffer_init()
687 if (nr_pages <= 0) in rb_alloc_aux()
710 max_order = ilog2(nr_pages); in rb_alloc_aux()
796 if (pgoff > rb->nr_pages) in __perf_mmap_to_page()
832 size += nr_pages * sizeof(void *); in rb_alloc()
846 for (i = 0; i < nr_pages; i++) { in rb_alloc()
852 rb->nr_pages = nr_pages; in rb_alloc()
876 for (i = 0; i < rb->nr_pages; i++) in rb_free()
930 if (nr_pages) { in rb_alloc()
[all …]
/linux-6.15/fs/crypto/
H A Dbio.c123 unsigned int nr_pages; in fscrypt_zeroout_range() local
137 nr_pages = min_t(u64, ARRAY_SIZE(pages), in fscrypt_zeroout_range()
147 for (i = 0; i < nr_pages; i++) { in fscrypt_zeroout_range()
153 nr_pages = i; in fscrypt_zeroout_range()
154 if (WARN_ON_ONCE(nr_pages <= 0)) in fscrypt_zeroout_range()
158 bio = bio_alloc(inode->i_sb->s_bdev, nr_pages, REQ_OP_WRITE, GFP_NOFS); in fscrypt_zeroout_range()
184 } while (i != nr_pages && du_remaining != 0); in fscrypt_zeroout_range()
194 for (i = 0; i < nr_pages; i++) in fscrypt_zeroout_range()

12345678910>>...17