/kernel/linux/linux-5.10/tools/testing/selftests/vm/ |
H A D | mlock-random-test.c | 125 * With allocated memory chunk [p, p + alloc_size), this 130 * The memory region size alloc_size is within the rlimit. 138 int test_mlock_within_limit(char *p, int alloc_size) in test_mlock_within_limit() argument 147 if (cur.rlim_cur < alloc_size) { in test_mlock_within_limit() 148 printf("alloc_size[%d] < %u rlimit,lead to mlock failure\n", in test_mlock_within_limit() 149 alloc_size, (unsigned int)cur.rlim_cur); in test_mlock_within_limit() 157 * - choose lock_size randomly but lock_size < alloc_size in test_mlock_within_limit() 159 * < p+alloc_size in test_mlock_within_limit() 162 int lock_size = rand() % alloc_size; in test_mlock_within_limit() 163 int start_offset = rand() % (alloc_size in test_mlock_within_limit() 215 test_mlock_outof_limit(char *p, int alloc_size) test_mlock_outof_limit() argument [all...] |
/kernel/linux/linux-6.6/tools/testing/selftests/mm/ |
H A D | mlock-random-test.c | 126 * With allocated memory chunk [p, p + alloc_size), this 131 * The memory region size alloc_size is within the rlimit. 139 int test_mlock_within_limit(char *p, int alloc_size) in test_mlock_within_limit() argument 148 if (cur.rlim_cur < alloc_size) { in test_mlock_within_limit() 149 printf("alloc_size[%d] < %u rlimit,lead to mlock failure\n", in test_mlock_within_limit() 150 alloc_size, (unsigned int)cur.rlim_cur); in test_mlock_within_limit() 158 * - choose lock_size randomly but lock_size < alloc_size in test_mlock_within_limit() 160 * < p+alloc_size in test_mlock_within_limit() 163 int lock_size = rand() % alloc_size; in test_mlock_within_limit() 164 int start_offset = rand() % (alloc_size in test_mlock_within_limit() 216 test_mlock_outof_limit(char *p, int alloc_size) test_mlock_outof_limit() argument [all...] |
/kernel/linux/linux-6.6/lib/ |
H A D | fortify_kunit.c | 146 #define TEST_kmalloc(checker, expected_size, alloc_size) do { \ 151 checker(expected_size, kmalloc(alloc_size, gfp), \ 154 kmalloc_node(alloc_size, gfp, NUMA_NO_NODE), \ 156 checker(expected_size, kzalloc(alloc_size, gfp), \ 159 kzalloc_node(alloc_size, gfp, NUMA_NO_NODE), \ 161 checker(expected_size, kcalloc(1, alloc_size, gfp), \ 163 checker(expected_size, kcalloc(alloc_size, 1, gfp), \ 166 kcalloc_node(1, alloc_size, gfp, NUMA_NO_NODE), \ 169 kcalloc_node(alloc_size, 1, gfp, NUMA_NO_NODE), \ 171 checker(expected_size, kmalloc_array(1, alloc_size, gf [all...] |
H A D | scatterlist.c | 207 unsigned int alloc_size = num_ents; in __sg_free_table() local 216 if (alloc_size > curr_max_ents) { in __sg_free_table() 218 alloc_size = curr_max_ents; in __sg_free_table() 219 sg_size = alloc_size - 1; in __sg_free_table() 221 sg_size = alloc_size; in __sg_free_table() 229 free_fn(sgl, alloc_size); in __sg_free_table() 307 unsigned int sg_size, alloc_size = left; in __sg_alloc_table() local 309 if (alloc_size > curr_max_ents) { in __sg_alloc_table() 310 alloc_size = curr_max_ents; in __sg_alloc_table() 311 sg_size = alloc_size in __sg_alloc_table() 392 unsigned int alloc_size; get_next_sg() local [all...] |
/kernel/linux/linux-5.10/drivers/firmware/efi/libstub/ |
H A D | file.c | 144 unsigned long alloc_size; in handle_cmdline_files() local 157 alloc_addr = alloc_size = 0; in handle_cmdline_files() 187 * alloc_size == 0 in that case. in handle_cmdline_files() 189 if (round_up(alloc_size + size, EFI_ALLOC_ALIGN) > in handle_cmdline_files() 190 round_up(alloc_size, EFI_ALLOC_ALIGN)) { in handle_cmdline_files() 195 status = efi_allocate_pages(alloc_size + size, in handle_cmdline_files() 199 status = efi_allocate_pages(alloc_size + size, in handle_cmdline_files() 214 memcpy((void *)alloc_addr, (void *)old_addr, alloc_size); in handle_cmdline_files() 215 efi_free(alloc_size, old_addr); in handle_cmdline_files() 219 addr = (void *)alloc_addr + alloc_size; in handle_cmdline_files() [all...] |
H A D | relocate.c | 93 * @alloc_size: minimum size of memory to allocate, must be greater or 112 unsigned long alloc_size, in efi_relocate_kernel() 123 if (!image_addr || !image_size || !alloc_size) in efi_relocate_kernel() 125 if (alloc_size < image_size) in efi_relocate_kernel() 138 nr_pages = round_up(alloc_size, EFI_ALLOC_ALIGN) / EFI_PAGE_SIZE; in efi_relocate_kernel() 147 status = efi_low_alloc_above(alloc_size, alignment, &new_addr, in efi_relocate_kernel() 110 efi_relocate_kernel(unsigned long *image_addr, unsigned long image_size, unsigned long alloc_size, unsigned long preferred_addr, unsigned long alignment, unsigned long min_addr) efi_relocate_kernel() argument
|
H A D | arm32-stub.c | 123 int alloc_size = MAX_UNCOMP_KERNEL_SIZE + EFI_PHYS_ALIGN; in handle_kernel_image() local 133 status = efi_low_alloc_above(alloc_size, EFI_PAGE_SIZE, &alloc_base, 0x0); in handle_kernel_image() 158 alloc_size -= *reserve_addr - alloc_base; in handle_kernel_image() 161 (alloc_size - MAX_UNCOMP_KERNEL_SIZE) / EFI_PAGE_SIZE); in handle_kernel_image()
|
/kernel/linux/linux-6.6/drivers/firmware/efi/libstub/ |
H A D | zboot.c | 40 static unsigned long alloc_preferred_address(unsigned long alloc_size) in alloc_preferred_address() argument 46 alloc_size / EFI_PAGE_SIZE, &efi_addr) == EFI_SUCCESS) in alloc_preferred_address() 53 unsigned long alloc_size) in efi_cache_sync_image() 68 unsigned long image_base, alloc_size; in efi_zboot_entry() local 93 alloc_size = round_up(get_unaligned_le32(_gzdata_end - 4), in efi_zboot_entry() 98 image_base = alloc_preferred_address(alloc_size); in efi_zboot_entry() 121 status = efi_random_alloc(alloc_size, min_kimg_align, &image_base, in efi_zboot_entry() 131 (void *)image_base, alloc_size, NULL, error); in efi_zboot_entry() 138 efi_cache_sync_image(image_base, alloc_size); in efi_zboot_entry() 143 efi_free(alloc_size, image_bas in efi_zboot_entry() 52 efi_cache_sync_image(unsigned long image_base, unsigned long alloc_size) efi_cache_sync_image() argument [all...] |
H A D | file.c | 198 unsigned long alloc_size; in handle_cmdline_files() local 211 alloc_addr = alloc_size = 0; in handle_cmdline_files() 243 * alloc_size == 0 in that case. in handle_cmdline_files() 245 if (round_up(alloc_size + size, EFI_ALLOC_ALIGN) > in handle_cmdline_files() 246 round_up(alloc_size, EFI_ALLOC_ALIGN)) { in handle_cmdline_files() 251 status = efi_allocate_pages(alloc_size + size, in handle_cmdline_files() 255 status = efi_allocate_pages(alloc_size + size, in handle_cmdline_files() 270 memcpy((void *)alloc_addr, (void *)old_addr, alloc_size); in handle_cmdline_files() 271 efi_free(alloc_size, old_addr); in handle_cmdline_files() 275 addr = (void *)alloc_addr + alloc_size; in handle_cmdline_files() [all...] |
H A D | relocate.c | 93 * @alloc_size: minimum size of memory to allocate, must be greater or 112 unsigned long alloc_size, in efi_relocate_kernel() 123 if (!image_addr || !image_size || !alloc_size) in efi_relocate_kernel() 125 if (alloc_size < image_size) in efi_relocate_kernel() 138 nr_pages = round_up(alloc_size, EFI_ALLOC_ALIGN) / EFI_PAGE_SIZE; in efi_relocate_kernel() 147 status = efi_low_alloc_above(alloc_size, alignment, &new_addr, in efi_relocate_kernel() 110 efi_relocate_kernel(unsigned long *image_addr, unsigned long image_size, unsigned long alloc_size, unsigned long preferred_addr, unsigned long alignment, unsigned long min_addr) efi_relocate_kernel() argument
|
H A D | arm32-stub.c | 87 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()
|
/kernel/linux/linux-5.10/kernel/dma/ |
H A D | swiotlb.c | 209 size_t alloc_size; in swiotlb_init_with_tbl() local 222 alloc_size = PAGE_ALIGN(io_tlb_nslabs * sizeof(int)); in swiotlb_init_with_tbl() 223 io_tlb_list = memblock_alloc(alloc_size, PAGE_SIZE); in swiotlb_init_with_tbl() 226 __func__, alloc_size, PAGE_SIZE); in swiotlb_init_with_tbl() 228 alloc_size = PAGE_ALIGN(io_tlb_nslabs * sizeof(phys_addr_t)); in swiotlb_init_with_tbl() 229 io_tlb_orig_addr = memblock_alloc(alloc_size, PAGE_SIZE); in swiotlb_init_with_tbl() 232 __func__, alloc_size, PAGE_SIZE); in swiotlb_init_with_tbl() 490 size_t alloc_size) in find_slots() 498 unsigned int nslots = nr_slots(alloc_size), stride; in find_slots() 510 if (alloc_size > in find_slots() 489 find_slots(struct device *dev, phys_addr_t orig_addr, size_t alloc_size) find_slots() argument 564 swiotlb_tbl_map_single(struct device *dev, phys_addr_t orig_addr, size_t mapping_size, size_t alloc_size, enum dma_data_direction dir, unsigned long attrs) swiotlb_tbl_map_single() argument 617 swiotlb_tbl_unmap_single(struct device *hwdev, phys_addr_t tlb_addr, size_t mapping_size, size_t alloc_size, enum dma_data_direction dir, unsigned long attrs) swiotlb_tbl_unmap_single() argument [all...] |
/kernel/linux/linux-6.6/kernel/dma/ |
H A D | swiotlb.c | 69 * @alloc_size: Size of the allocated buffer. 75 size_t alloc_size; member 289 mem->slots[i].alloc_size = 0; in swiotlb_init_io_tlb_pool() 356 size_t alloc_size; in swiotlb_init_remap() local 394 alloc_size = PAGE_ALIGN(array_size(sizeof(*mem->slots), nslabs)); in swiotlb_init_remap() 395 mem->slots = memblock_alloc(alloc_size, PAGE_SIZE); in swiotlb_init_remap() 398 __func__, alloc_size, PAGE_SIZE); in swiotlb_init_remap() 841 size_t alloc_size = mem->slots[index].alloc_size; in swiotlb_bounce() local 859 if (tlb_offset > alloc_size) { in swiotlb_bounce() 975 swiotlb_area_find_slots(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_area_find_slots() argument 1083 swiotlb_pool_find_slots(struct device *dev, struct io_tlb_pool *pool, phys_addr_t orig_addr, size_t alloc_size, unsigned int alloc_align_mask) swiotlb_pool_find_slots() argument 1118 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 1191 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 1266 swiotlb_tbl_map_single(struct device *dev, phys_addr_t orig_addr, size_t mapping_size, size_t alloc_size, unsigned int alloc_align_mask, enum dma_data_direction dir, unsigned long attrs) swiotlb_tbl_map_single() argument [all...] |
/kernel/linux/linux-5.10/lib/ |
H A D | scatterlist.c | 203 unsigned int alloc_size = table->orig_nents; in __sg_free_table() local 212 if (alloc_size > curr_max_ents) { in __sg_free_table() 214 alloc_size = curr_max_ents; in __sg_free_table() 215 sg_size = alloc_size - 1; in __sg_free_table() 217 sg_size = alloc_size; in __sg_free_table() 225 free_fn(sgl, alloc_size); in __sg_free_table() 288 unsigned int sg_size, alloc_size = left; in __sg_alloc_table() local 290 if (alloc_size > curr_max_ents) { in __sg_alloc_table() 291 alloc_size = curr_max_ents; in __sg_alloc_table() 292 sg_size = alloc_size in __sg_alloc_table() 374 unsigned int alloc_size; get_next_sg() local [all...] |
/kernel/linux/linux-5.10/drivers/net/ethernet/mellanox/mlxsw/ |
H A D | spectrum1_kvdl.c | 35 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() 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() 71 mlxsw_sp1_kvdl_alloc_size_part(struct mlxsw_sp1_kvdl *kvdl, unsigned int alloc_size) mlxsw_sp1_kvdl_alloc_size_part() argument [all...] |
/kernel/linux/linux-6.6/drivers/net/ethernet/mellanox/mlxsw/ |
H A D | spectrum1_kvdl.c | 35 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() 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() 71 mlxsw_sp1_kvdl_alloc_size_part(struct mlxsw_sp1_kvdl *kvdl, unsigned int alloc_size) mlxsw_sp1_kvdl_alloc_size_part() argument [all...] |
/kernel/linux/linux-5.10/tools/testing/selftests/powerpc/stringloops/ |
H A D | memcmp.c | 76 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()
|
/kernel/linux/linux-6.6/tools/testing/selftests/powerpc/stringloops/ |
H A D | memcmp.c | 76 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()
|
/kernel/linux/linux-5.10/mm/ |
H A D | percpu.c | 1302 size_t alloc_size; in pcpu_alloc_first_chunk() local 1318 alloc_size = struct_size(chunk, populated, in pcpu_alloc_first_chunk() 1320 chunk = memblock_alloc(alloc_size, SMP_CACHE_BYTES); in pcpu_alloc_first_chunk() 1323 alloc_size); in pcpu_alloc_first_chunk() 1334 alloc_size = BITS_TO_LONGS(region_bits) * sizeof(chunk->alloc_map[0]); in pcpu_alloc_first_chunk() 1335 chunk->alloc_map = memblock_alloc(alloc_size, SMP_CACHE_BYTES); in pcpu_alloc_first_chunk() 1338 alloc_size); in pcpu_alloc_first_chunk() 1340 alloc_size = in pcpu_alloc_first_chunk() 1342 chunk->bound_map = memblock_alloc(alloc_size, SMP_CACHE_BYTES); in pcpu_alloc_first_chunk() 1345 alloc_size); in pcpu_alloc_first_chunk() 2415 size_t alloc_size; pcpu_setup_first_chunk() local 2674 size_t size_sum, min_unit_size, alloc_size; pcpu_build_alloc_info() local [all...] |
/kernel/linux/linux-5.10/fs/ocfs2/ |
H A D | move_extents.c | 733 static void ocfs2_calc_extent_defrag_len(u32 *alloc_size, u32 *len_defraged, in ocfs2_calc_extent_defrag_len() argument 736 if ((*alloc_size + *len_defraged) < threshold) { in ocfs2_calc_extent_defrag_len() 740 *len_defraged += *alloc_size; in ocfs2_calc_extent_defrag_len() 755 *alloc_size = threshold - *len_defraged; in ocfs2_calc_extent_defrag_len() 764 u32 cpos, phys_cpos, move_start, len_to_move, alloc_size; in __ocfs2_move_extents_range() local 821 ret = ocfs2_get_clusters(inode, cpos, &phys_cpos, &alloc_size, in __ocfs2_move_extents_range() 828 if (alloc_size > len_to_move) in __ocfs2_move_extents_range() 829 alloc_size = len_to_move; in __ocfs2_move_extents_range() 845 ocfs2_calc_extent_defrag_len(&alloc_size, &len_defraged, in __ocfs2_move_extents_range() 856 "alloc_size in __ocfs2_move_extents_range() [all...] |
/kernel/linux/linux-6.6/fs/ocfs2/ |
H A D | move_extents.c | 731 static void ocfs2_calc_extent_defrag_len(u32 *alloc_size, u32 *len_defraged, in ocfs2_calc_extent_defrag_len() argument 734 if ((*alloc_size + *len_defraged) < threshold) { in ocfs2_calc_extent_defrag_len() 738 *len_defraged += *alloc_size; in ocfs2_calc_extent_defrag_len() 753 *alloc_size = threshold - *len_defraged; in ocfs2_calc_extent_defrag_len() 762 u32 cpos, phys_cpos, move_start, len_to_move, alloc_size; in __ocfs2_move_extents_range() local 819 ret = ocfs2_get_clusters(inode, cpos, &phys_cpos, &alloc_size, in __ocfs2_move_extents_range() 826 if (alloc_size > len_to_move) in __ocfs2_move_extents_range() 827 alloc_size = len_to_move; in __ocfs2_move_extents_range() 843 ocfs2_calc_extent_defrag_len(&alloc_size, &len_defraged, in __ocfs2_move_extents_range() 854 "alloc_size in __ocfs2_move_extents_range() [all...] |
/kernel/linux/linux-6.6/mm/ |
H A D | percpu.c | 1351 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(alloc_size, SMP_CACHE_BYTES); in pcpu_alloc_first_chunk() 1365 alloc_size); in pcpu_alloc_first_chunk() 1376 alloc_size = BITS_TO_LONGS(region_bits) * sizeof(chunk->alloc_map[0]); in pcpu_alloc_first_chunk() 1377 chunk->alloc_map = memblock_alloc(alloc_size, SMP_CACHE_BYTES); in pcpu_alloc_first_chunk() 1380 alloc_size); in pcpu_alloc_first_chunk() 1382 alloc_size = in pcpu_alloc_first_chunk() 1384 chunk->bound_map = memblock_alloc(alloc_size, SMP_CACHE_BYTES); in pcpu_alloc_first_chunk() 1387 alloc_size); in pcpu_alloc_first_chunk() 2593 size_t alloc_size; pcpu_setup_first_chunk() local 2847 size_t size_sum, min_unit_size, alloc_size; pcpu_build_alloc_info() local [all...] |
/kernel/linux/linux-5.10/drivers/gpu/drm/vmwgfx/ |
H A D | vmwgfx_simple_resource.c | 156 size_t alloc_size; in vmw_simple_resource_create_ioctl() local 160 alloc_size = offsetof(struct vmw_user_simple_resource, simple) + in vmw_simple_resource_create_ioctl() 162 account_size = ttm_round_pot(alloc_size) + VMW_IDA_ACC_SIZE + in vmw_simple_resource_create_ioctl() 180 usimple = kzalloc(alloc_size, GFP_KERNEL); in vmw_simple_resource_create_ioctl()
|
/kernel/linux/linux-6.6/fs/ntfs3/ |
H A D | attrib.c | 454 old_alloc = le64_to_cpu(attr_b->nres.alloc_size); in attr_set_size() 519 * - update attr_b->nres.data_size/attr_b->nres.alloc_size in attr_set_size() 599 attr_b->nres.alloc_size = cpu_to_le64(new_alloc_tmp); in attr_set_size() 612 attr_b->nres.data_size = attr_b->nres.alloc_size; in attr_set_size() 622 attr_b->nres.data_size = attr_b->nres.alloc_size; in attr_set_size() 685 attr_b->nres.alloc_size = cpu_to_le64(old_size); in attr_set_size() 696 * - update attr_b->nres.data_size/attr_b->nres.alloc_size in attr_set_size() 731 attr_b->nres.alloc_size = cpu_to_le64(new_alloc_tmp); in attr_set_size() 742 attr_b->nres.alloc_size; in attr_set_size() 746 attr_b->nres.alloc_size; in attr_set_size() 1857 u64 valid_size, data_size, alloc_size, total_size; attr_collapse_range() local 2114 u64 total_size, alloc_size; attr_punch_hole() local 2332 u64 data_size, alloc_size; attr_insert_range() local [all...] |
/kernel/linux/linux-5.10/net/openvswitch/ |
H A D | vport.c | 124 size_t alloc_size; in ovs_vport_alloc() local 126 alloc_size = sizeof(struct vport); in ovs_vport_alloc() 128 alloc_size = ALIGN(alloc_size, VPORT_ALIGN); in ovs_vport_alloc() 129 alloc_size += priv_size; in ovs_vport_alloc() 132 vport = kzalloc(alloc_size, GFP_KERNEL); in ovs_vport_alloc()
|