Home
last modified time | relevance | path

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

1234567

/linux/tools/testing/selftests/mm/
H A Dmlock-random-test.c119 * With allocated memory chunk [p, p + alloc_size), this
124 * The memory region size alloc_size is within the rlimit.
132 static void test_mlock_within_limit(char *p, int alloc_size) in test_mlock_within_limit() argument
141 if (cur.rlim_cur < alloc_size) in test_mlock_within_limit()
142 ksft_exit_fail_msg("alloc_size[%d] < %u rlimit,lead to mlock failure\n", in test_mlock_within_limit()
143 alloc_size, (unsigned int)cur.rlim_cur); in test_mlock_within_limit()
149 * - choose lock_size randomly but lock_size < alloc_size in test_mlock_within_limit()
151 * < p+alloc_size in test_mlock_within_limit()
154 int lock_size = rand() % alloc_size; in test_mlock_within_limit()
155 int start_offset = rand() % (alloc_size in test_mlock_within_limit()
199 test_mlock_outof_limit(char * p,int alloc_size) test_mlock_outof_limit() argument
[all...]
H A Ddroppable.c20 size_t alloc_size = 134217728; in main() local
28 alloc = mmap(0, alloc_size, PROT_READ | PROT_WRITE, MAP_ANONYMOUS | MAP_DROPPABLE, -1, 0); in main()
30 memset(alloc, 'A', alloc_size); in main()
31 for (size_t i = 0; i < alloc_size; i += page_size) in main()
42 for (size_t i = 0; i < alloc_size; i += page_size) { in main()
/linux/drivers/firmware/efi/libstub/
H A Dzboot.c10 static unsigned long alloc_preferred_address(unsigned long alloc_size) in alloc_preferred_address() argument
16 alloc_size / EFI_PAGE_SIZE, &efi_addr) == EFI_SUCCESS) in alloc_preferred_address()
23 unsigned long alloc_size) in efi_cache_sync_image() argument
38 unsigned long image_base, alloc_size; in efi_zboot_entry() local
57 status = efi_zboot_decompress_init(&alloc_size); in efi_zboot_entry()
63 image_base = alloc_preferred_address(alloc_size); in efi_zboot_entry()
86 status = efi_random_alloc(alloc_size, min_kimg_align, &image_base, in efi_zboot_entry()
95 status = efi_zboot_decompress((void *)image_base, alloc_size) ?: in efi_zboot_entry()
98 efi_free(alloc_size, image_base); in efi_zboot_entry()
H A Dfile.c206 unsigned long alloc_size; in handle_cmdline_files() local
220 alloc_addr = alloc_size = 0; in handle_cmdline_files()
262 * alloc_size == 0 in that case. in handle_cmdline_files()
264 if (round_up(alloc_size + size, EFI_ALLOC_ALIGN) > in handle_cmdline_files()
265 round_up(alloc_size, EFI_ALLOC_ALIGN)) { in handle_cmdline_files()
270 status = efi_allocate_pages(alloc_size + size, in handle_cmdline_files()
274 status = efi_allocate_pages(alloc_size + size, in handle_cmdline_files()
289 memcpy((void *)alloc_addr, (void *)old_addr, alloc_size); in handle_cmdline_files()
290 efi_free(alloc_size, old_addr); in handle_cmdline_files()
294 addr = (void *)alloc_addr + alloc_size; in handle_cmdline_files()
[all...]
H A Drelocate.c94 * @alloc_size: minimum size of memory to allocate, must be greater or
113 unsigned long alloc_size, in efi_relocate_kernel() argument
124 if (!image_addr || !image_size || !alloc_size) in efi_relocate_kernel()
126 if (alloc_size < image_size) in efi_relocate_kernel()
139 nr_pages = round_up(alloc_size, EFI_ALLOC_ALIGN) / EFI_PAGE_SIZE; in efi_relocate_kernel()
148 status = efi_low_alloc_above(alloc_size, alignment, &new_addr, in efi_relocate_kernel()
H A Darm32-stub.c87 int alloc_size = MAX_UNCOMP_KERNEL_SIZE + EFI_PHYS_ALIGN; in handle_kernel_image() local
97 status = efi_low_alloc_above(alloc_size, EFI_PAGE_SIZE, &alloc_base, 0x0); in handle_kernel_image()
122 alloc_size -= *reserve_addr - alloc_base; in handle_kernel_image()
125 (alloc_size - MAX_UNCOMP_KERNEL_SIZE) / EFI_PAGE_SIZE); in handle_kernel_image()
H A Dzboot-decompress-zstd.c17 efi_status_t efi_zboot_decompress_init(unsigned long *alloc_size) in efi_zboot_decompress_init() argument
26 *alloc_size = payload_size; in efi_zboot_decompress_init()
/linux/drivers/net/wireless/intel/iwlwifi/pcie/
H A Dutils.c20 u32 i, pos, alloc_size, *ptr, *buf; in iwl_trans_pcie_dump_regs() local
32 alloc_size = PCI_ERR_ROOT_ERR_SRC + 4 + PREFIX_LEN; in iwl_trans_pcie_dump_regs()
33 alloc_size = max_t(u32, alloc_size, PCI_DUMP_SIZE + PREFIX_LEN); in iwl_trans_pcie_dump_regs()
34 alloc_size = max_t(u32, alloc_size, PCI_MEM_DUMP_SIZE + PREFIX_LEN); in iwl_trans_pcie_dump_regs()
35 alloc_size = max_t(u32, alloc_size, PCI_PARENT_DUMP_SIZE + PREFIX_LEN); in iwl_trans_pcie_dump_regs()
37 buf = kmalloc(alloc_size, GFP_ATOMIC); in iwl_trans_pcie_dump_regs()
40 prefix = (char *)buf + alloc_size in iwl_trans_pcie_dump_regs()
[all...]
/linux/drivers/net/ethernet/mellanox/mlxsw/
H A Dspectrum1_kvdl.c35 unsigned int alloc_size; member
49 .alloc_size = MLXSW_SP1_KVDL_##id##_ALLOC_SIZE, \
72 unsigned int alloc_size) in mlxsw_sp1_kvdl_alloc_size_part() argument
79 if (alloc_size <= part->info.alloc_size && in mlxsw_sp1_kvdl_alloc_size_part()
81 part->info.alloc_size <= min_part->info.alloc_size)) in mlxsw_sp1_kvdl_alloc_size_part()
108 return info->start_index + entry_index * info->alloc_size; in mlxsw_sp1_kvdl_to_kvdl_index()
115 return (kvdl_index - info->start_index) / info->alloc_size; in mlxsw_sp1_kvdl_to_entry_index()
125 info->alloc_size; in mlxsw_sp1_kvdl_part_alloc()
[all...]
/linux/tools/testing/selftests/powerpc/stringloops/
H A Dmemcmp.c76 unsigned long i, comp_size, alloc_size; in testcase() local
81 alloc_size = comp_size + MAX_OFFSET_DIFF_S1_S2; in testcase()
89 s1 = p + MAP_SIZE - alloc_size; in testcase()
90 s2 = p + 3 * MAP_SIZE - alloc_size; in testcase()
104 for (j = 0; j < alloc_size; j++) in testcase()
130 for (j = 0; j < alloc_size; j++) in testcase()
/linux/kernel/dma/
H A Dswiotlb.c69 * @alloc_size: Size of the allocated buffer.
77 size_t alloc_size; member
292 mem->slots[i].alloc_size = 0; in swiotlb_init_io_tlb_pool()
360 size_t alloc_size; in swiotlb_init_remap() local
398 alloc_size = PAGE_ALIGN(array_size(sizeof(*mem->slots), nslabs)); in swiotlb_init_remap()
399 mem->slots = memblock_alloc(alloc_size, PAGE_SIZE); in swiotlb_init_remap()
402 __func__, alloc_size, PAGE_SIZE); in swiotlb_init_remap()
864 size_t alloc_size = mem->slots[index].alloc_size; in swiotlb_bounce() local
886 alloc_size in swiotlb_bounce()
1017 swiotlb_search_pool_area(struct device * dev,struct io_tlb_pool * pool,int area_index,phys_addr_t orig_addr,size_t alloc_size,unsigned int alloc_align_mask) swiotlb_search_pool_area() argument
1142 swiotlb_search_area(struct device * dev,int start_cpu,int cpu_offset,phys_addr_t orig_addr,size_t alloc_size,unsigned int alloc_align_mask,struct io_tlb_pool ** retpool) swiotlb_search_area() argument
1182 swiotlb_find_slots(struct device * dev,phys_addr_t orig_addr,size_t alloc_size,unsigned int alloc_align_mask,struct io_tlb_pool ** retpool) swiotlb_find_slots() argument
1258 swiotlb_find_slots(struct device * dev,phys_addr_t orig_addr,size_t alloc_size,unsigned int alloc_align_mask,struct io_tlb_pool ** retpool) swiotlb_find_slots() argument
[all...]
/linux/lib/tests/
H A Dfortify_kunit.c219 #define TEST_kmalloc(checker, expected_size, alloc_size) do { \ argument
224 checker(expected_size, kmalloc(alloc_size, gfp), \
227 kmalloc_node(alloc_size, gfp, NUMA_NO_NODE), \
229 checker(expected_size, kzalloc(alloc_size, gfp), \
232 kzalloc_node(alloc_size, gfp, NUMA_NO_NODE), \
234 checker(expected_size, kcalloc(1, alloc_size, gfp), \
236 checker(expected_size, kcalloc(alloc_size, 1, gfp), \
239 kcalloc_node(1, alloc_size, gfp, NUMA_NO_NODE), \
242 kcalloc_node(alloc_size, 1, gfp, NUMA_NO_NODE), \
244 checker(expected_size, kmalloc_array(1, alloc_size, gf
331 TEST_devm_kmalloc(checker,expected_size,alloc_size) global() argument
[all...]
/linux/lib/
H A Dscatterlist.c185 unsigned int alloc_size = num_ents; in __sg_free_table() local
194 if (alloc_size > curr_max_ents) { in __sg_free_table()
196 alloc_size = curr_max_ents; in __sg_free_table()
197 sg_size = alloc_size - 1; in __sg_free_table()
199 sg_size = alloc_size; in __sg_free_table()
207 free_fn(sgl, alloc_size); in __sg_free_table()
285 unsigned int sg_size, alloc_size = left; in __sg_alloc_table() local
287 if (alloc_size > curr_max_ents) { in __sg_alloc_table()
288 alloc_size = curr_max_ents; in __sg_alloc_table()
289 sg_size = alloc_size in __sg_alloc_table()
370 unsigned int alloc_size; get_next_sg() local
[all...]
H A Dtest_kho.c134 size_t alloc_size = 0; in kho_test_generate_data() local
137 while (alloc_size < max_mem) { in kho_test_generate_data()
144 if (alloc_size + (PAGE_SIZE << order) > max_mem) { in kho_test_generate_data()
145 order = get_order(max_mem - alloc_size); in kho_test_generate_data()
159 alloc_size += size; in kho_test_generate_data()
/linux/fs/ocfs2/
H A Dmove_extents.c730 static void ocfs2_calc_extent_defrag_len(u32 *alloc_size, u32 *len_defraged, in ocfs2_calc_extent_defrag_len() argument
733 if ((*alloc_size + *len_defraged) < threshold) { in ocfs2_calc_extent_defrag_len()
737 *len_defraged += *alloc_size; in ocfs2_calc_extent_defrag_len()
752 *alloc_size = threshold - *len_defraged; in ocfs2_calc_extent_defrag_len()
761 u32 cpos, phys_cpos, move_start, len_to_move, alloc_size; in __ocfs2_move_extents_range() local
818 ret = ocfs2_get_clusters(inode, cpos, &phys_cpos, &alloc_size, in __ocfs2_move_extents_range()
825 if (alloc_size > len_to_move) in __ocfs2_move_extents_range()
826 alloc_size = len_to_move; in __ocfs2_move_extents_range()
842 ocfs2_calc_extent_defrag_len(&alloc_size, &len_defraged, in __ocfs2_move_extents_range()
853 "alloc_size in __ocfs2_move_extents_range()
[all...]
/linux/tools/testing/selftests/rseq/
H A Drseq.c122 unsigned int alloc_size = rseq_size; in get_rseq_min_alloc_size() local
124 if (alloc_size < ORIG_RSEQ_ALLOC_SIZE) in get_rseq_min_alloc_size()
125 alloc_size = ORIG_RSEQ_ALLOC_SIZE; in get_rseq_min_alloc_size()
126 return alloc_size; in get_rseq_min_alloc_size()
/linux/mm/kasan/
H A Dreport.c307 } else if (access_addr >= object_addr + info->alloc_size) { in describe_object_addr()
309 rel_bytes = access_addr - (object_addr + info->alloc_size); in describe_object_addr()
331 rel_bytes, rel_type, region_state, info->alloc_size, in describe_object_addr()
332 (void *)object_addr, (void *)(object_addr + info->alloc_size)); in describe_object_addr()
506 info->alloc_size = kasan_get_alloc_size(info->object, info->cache); in complete_report_info()
508 if (!info->alloc_size) in complete_report_info()
509 info->alloc_size = info->cache->object_size; in complete_report_info()
/linux/mm/
H A Dpercpu.c1351 size_t alloc_size; in pcpu_alloc_first_chunk() local
1360 alloc_size = struct_size(chunk, populated, in pcpu_alloc_first_chunk()
1362 chunk = memblock_alloc_or_panic(alloc_size, SMP_CACHE_BYTES); in pcpu_alloc_first_chunk()
1373 alloc_size = BITS_TO_LONGS(region_bits) * sizeof(chunk->alloc_map[0]); in pcpu_alloc_first_chunk()
1374 chunk->alloc_map = memblock_alloc_or_panic(alloc_size, SMP_CACHE_BYTES); in pcpu_alloc_first_chunk()
1376 alloc_size = in pcpu_alloc_first_chunk()
1378 chunk->bound_map = memblock_alloc_or_panic(alloc_size, SMP_CACHE_BYTES); in pcpu_alloc_first_chunk()
1380 alloc_size = pcpu_chunk_nr_blocks(chunk) * sizeof(chunk->md_blocks[0]); in pcpu_alloc_first_chunk()
1381 chunk->md_blocks = memblock_alloc_or_panic(alloc_size, SMP_CACHE_BYTES); in pcpu_alloc_first_chunk()
2461 upa = ai->alloc_size / a in pcpu_dump_alloc_info()
2559 size_t alloc_size; pcpu_setup_first_chunk() local
2798 size_t size_sum, min_unit_size, alloc_size; pcpu_build_alloc_info() local
[all...]
/linux/fs/ntfs3/
H A Dattrib.c456 old_alloc = le64_to_cpu(attr_b->nres.alloc_size); in attr_set_size()
521 * - update attr_b->nres.data_size/attr_b->nres.alloc_size in attr_set_size()
601 attr_b->nres.alloc_size = cpu_to_le64(new_alloc_tmp); in attr_set_size()
614 attr_b->nres.data_size = attr_b->nres.alloc_size; in attr_set_size()
624 attr_b->nres.data_size = attr_b->nres.alloc_size; in attr_set_size()
688 attr_b->nres.alloc_size = cpu_to_le64(old_size); in attr_set_size()
699 * - update attr_b->nres.data_size/attr_b->nres.alloc_size in attr_set_size()
734 attr_b->nres.alloc_size = cpu_to_le64(new_alloc_tmp); in attr_set_size()
745 attr_b->nres.alloc_size; in attr_set_size()
749 attr_b->nres.alloc_size; in attr_set_size()
1867 u64 valid_size, data_size, alloc_size, total_size; attr_collapse_range() local
2124 u64 total_size, alloc_size; attr_punch_hole() local
2342 u64 data_size, alloc_size; attr_insert_range() local
[all...]
/linux/arch/arm64/mm/
H A Dgcs.c73 unsigned long alloc_size; in SYSCALL_DEFINE3() local
96 alloc_size = PAGE_ALIGN(size); in SYSCALL_DEFINE3()
97 if (alloc_size < size) in SYSCALL_DEFINE3()
100 addr = alloc_gcs(addr, alloc_size); in SYSCALL_DEFINE3()
/linux/drivers/md/
H A Ddm-stats.c84 static bool __check_shared_memory(size_t alloc_size) in __check_shared_memory() argument
88 a = shared_memory_amount + alloc_size; in __check_shared_memory()
100 static bool check_shared_memory(size_t alloc_size) in check_shared_memory() argument
106 ret = __check_shared_memory(alloc_size); in check_shared_memory()
113 static bool claim_shared_memory(size_t alloc_size) in claim_shared_memory() argument
117 if (!__check_shared_memory(alloc_size)) { in claim_shared_memory()
122 shared_memory_amount += alloc_size; in claim_shared_memory()
129 static void free_shared_memory(size_t alloc_size) in free_shared_memory() argument
135 if (WARN_ON_ONCE(shared_memory_amount < alloc_size)) { in free_shared_memory()
141 shared_memory_amount -= alloc_size; in free_shared_memory()
146 dm_kvzalloc(size_t alloc_size,int node) dm_kvzalloc() argument
162 dm_kvfree(void * ptr,size_t alloc_size) dm_kvfree() argument
[all...]
/linux/sound/soc/sof/
H A Dsof-client-ipc-msg-injector.c258 size_t alloc_size; in sof_msg_inject_probe() local
267 alloc_size = priv->max_msg_size; in sof_msg_inject_probe()
270 alloc_size += sizeof(struct sof_ipc4_msg); in sof_msg_inject_probe()
272 priv->tx_buffer = devm_kmalloc(dev, alloc_size, GFP_KERNEL); in sof_msg_inject_probe()
273 priv->rx_buffer = devm_kzalloc(dev, alloc_size, GFP_KERNEL); in sof_msg_inject_probe()
H A Dsof-client-ipc-kernel-injector.c97 size_t alloc_size; in sof_msg_inject_probe() local
105 alloc_size = priv->max_msg_size; in sof_msg_inject_probe()
106 priv->kernel_buffer = devm_kmalloc(dev, alloc_size, GFP_KERNEL); in sof_msg_inject_probe()
/linux/drivers/gpu/drm/vmwgfx/
H A Dvmwgfx_simple_resource.c147 size_t alloc_size; in vmw_simple_resource_create_ioctl() local
150 alloc_size = offsetof(struct vmw_user_simple_resource, simple) + in vmw_simple_resource_create_ioctl()
153 usimple = kzalloc(alloc_size, GFP_KERNEL); in vmw_simple_resource_create_ioctl()
/linux/net/openvswitch/
H A Dvport.c126 size_t alloc_size; in ovs_vport_alloc() local
129 alloc_size = sizeof(struct vport); in ovs_vport_alloc()
131 alloc_size = ALIGN(alloc_size, VPORT_ALIGN); in ovs_vport_alloc()
132 alloc_size += priv_size; in ovs_vport_alloc()
135 vport = kzalloc(alloc_size, GFP_KERNEL); in ovs_vport_alloc()

1234567