Home
last modified time | relevance | path

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

123456

/linux/tools/testing/selftests/mm/
H A Dmlock-random-test.c132 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()
143 alloc_size, (unsigned int)cur.rlim_cur); in test_mlock_within_limit()
154 int lock_size = rand() % alloc_size; in test_mlock_within_limit()
155 int start_offset = rand() % (alloc_size - lock_size); in test_mlock_within_limit()
166 strerror(errno), p, alloc_size, in test_mlock_within_limit()
176 if (locked_vm_size > PAGE_ALIGN(alloc_size, page_size) + page_size) in test_mlock_within_limit()
178 __func__, locked_vm_size, alloc_size); in test_mlock_within_limit()
199 static void test_mlock_outof_limit(char *p, int alloc_size) in test_mlock_outof_limit() argument
207 if (cur.rlim_cur >= alloc_size) in test_mlock_outof_limit()
[all …]
H A Ddroppable.c20 const size_t alloc_size = 2 * 1024 * 1024; in main() local
28 alloc = mmap(0, alloc_size, PROT_READ | PROT_WRITE, MAP_ANONYMOUS | MAP_DROPPABLE, -1, 0); in main()
37 memset(alloc, 'A', alloc_size); in main()
40 if (madvise(alloc, alloc_size, MADV_PAGEOUT)) { in main()
49 dropped = memchr(alloc, 'A', alloc_size) == NULL; in main()
/linux/tools/testing/selftests/bpf/libarena/selftests/
H A Dtest_asan_buddy.bpf.c17 static __always_inline int asan_test_buddy_oob_single(size_t alloc_size) in asan_test_buddy_oob_single() argument
26 mem = buddy_alloc(&buddy, alloc_size); in asan_test_buddy_oob_single()
28 arena_stdout("buddy_alloc failed for size %lu", alloc_size); in asan_test_buddy_oob_single()
36 for (i = zero; i < alloc_size && can_loop; i++) { in asan_test_buddy_oob_single()
43 mem[alloc_size] = 0xba; in asan_test_buddy_oob_single()
44 ret = asan_validate_addr(true, &mem[alloc_size]); in asan_test_buddy_oob_single()
74 __weak int asan_test_buddy_uaf_single(size_t alloc_size) in asan_test_buddy_uaf_single() argument
80 mem = buddy_alloc(&buddy, alloc_size); in asan_test_buddy_uaf_single()
82 arena_stdout("buddy_alloc failed for size %lu", alloc_size); in asan_test_buddy_uaf_single()
90 for (i = zero; i < alloc_size && can_loop; i++) { in asan_test_buddy_uaf_single()
[all …]
/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 - PREFIX_LEN; in iwl_trans_pcie_dump_regs()
/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()
190 *p_alloc_size = part->info.alloc_size; in mlxsw_sp1_kvdl_alloc_size_query()
226 nr_entries = div_u64(resource_size, info->alloc_size); in mlxsw_sp1_kvdl_part_init()
[all …]
/linux/drivers/firmware/efi/libstub/
H A Dloongarch-stub.c41 unsigned long alloc_size, in efi_relocate_kernel() argument
52 if (!image_addr || !image_size || !alloc_size) in efi_relocate_kernel()
54 if (alloc_size < image_size) in efi_relocate_kernel()
67 nr_pages = round_up(alloc_size, EFI_ALLOC_ALIGN) / EFI_PAGE_SIZE; in efi_relocate_kernel()
76 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 Darm64.c94 unsigned long alloc_size) in efi_cache_sync_image() argument
116 efi_remap_image(image_base, alloc_size, code_size); in efi_cache_sync_image()
/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.c76 size_t alloc_size; member
345 pool->slots[i].alloc_size = 0; in swiotlb_mark_pool_used()
409 mem->slots[i].alloc_size = 0; in swiotlb_init_io_tlb_pool()
477 size_t alloc_size; in swiotlb_init_remap() local
514 alloc_size = PAGE_ALIGN(array_size(sizeof(*mem->slots), nslabs)); in swiotlb_init_remap()
515 mem->slots = memblock_alloc(alloc_size, PAGE_SIZE); in swiotlb_init_remap()
518 __func__, alloc_size, PAGE_SIZE); in swiotlb_init_remap()
1021 size_t alloc_size = mem->slots[index].alloc_size; in swiotlb_bounce() local
1045 alloc_size -= tlb_offset; in swiotlb_bounce()
1047 if (size > alloc_size) { in swiotlb_bounce()
[all …]
/linux/lib/
H A Dscatterlist.c210 unsigned int alloc_size = num_ents; in __sg_free_table() local
219 if (alloc_size > curr_max_ents) { in __sg_free_table()
221 alloc_size = curr_max_ents; in __sg_free_table()
222 sg_size = alloc_size - 1; in __sg_free_table()
224 sg_size = alloc_size; in __sg_free_table()
232 free_fn(sgl, alloc_size); in __sg_free_table()
310 unsigned int sg_size, alloc_size = left; in __sg_alloc_table() local
312 if (alloc_size > curr_max_ents) { in __sg_alloc_table()
313 alloc_size = curr_max_ents; in __sg_alloc_table()
314 sg_size = alloc_size - 1; in __sg_alloc_table()
[all …]
/linux/net/openvswitch/
H A Dvport.c123 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()
/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()
[all …]
/linux/fs/ntfs3/
H A Dattrib.c492 old_alloc = le64_to_cpu(attr_b->nres.alloc_size); in attr_set_size_ex()
669 attr_b->nres.alloc_size = cpu_to_le64(new_alloc_tmp); in attr_set_size_ex()
682 attr_b->nres.data_size = attr_b->nres.alloc_size; in attr_set_size_ex()
692 attr_b->nres.data_size = attr_b->nres.alloc_size; in attr_set_size_ex()
756 attr_b->nres.alloc_size = cpu_to_le64(old_size); in attr_set_size_ex()
802 attr_b->nres.alloc_size = cpu_to_le64(new_alloc_tmp); in attr_set_size_ex()
813 attr_b->nres.alloc_size; in attr_set_size_ex()
817 attr_b->nres.alloc_size; in attr_set_size_ex()
904 attr_b->nres.alloc_size = cpu_to_le64(old_alloc); in attr_set_size_ex()
1055 asize = le64_to_cpu(attr_b->nres.alloc_size) >> cluster_bits; in attr_data_get_block_locked()
[all …]
H A Drecord.c205 u64 svcn, evcn, data_size, alloc_size, tot_size; in mi_enum_attr() local
349 alloc_size = le64_to_cpu(attr->nres.alloc_size); in mi_enum_attr()
350 if (data_size > alloc_size) in mi_enum_attr()
354 if (alloc_size & t32) in mi_enum_attr()
367 if (tot_size > alloc_size) in mi_enum_attr()
373 if (alloc_size > mi->sbi->volume.size) in mi_enum_attr()
/linux/sound/soc/sof/
H A Dsof-client-ipc-msg-injector.c261 size_t alloc_size; in sof_msg_inject_probe() local
270 alloc_size = priv->max_msg_size; in sof_msg_inject_probe()
273 alloc_size += sizeof(struct sof_ipc4_msg); in sof_msg_inject_probe()
275 priv->tx_buffer = devm_kmalloc(dev, alloc_size, GFP_KERNEL); in sof_msg_inject_probe()
276 priv->rx_buffer = devm_kzalloc(dev, alloc_size, GFP_KERNEL); in sof_msg_inject_probe()
H A Dsof-client-ipc-kernel-injector.c98 size_t alloc_size; in sof_msg_inject_probe() local
106 alloc_size = priv->max_msg_size; in sof_msg_inject_probe()
107 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/tools/testing/selftests/vDSO/
H A Dvdso_test_getrandom.c64 size_t alloc_size, num = sysconf(_SC_NPROCESSORS_ONLN); /* Just a decent heuristic. */ in vgetrandom_get_state() local
69 alloc_size = (num * state_size_aligned + page_size - 1) & (~(page_size - 1)); in vgetrandom_get_state()
70 num = (page_size / state_size_aligned) * (alloc_size / page_size); in vgetrandom_get_state()
71 new_block = mmap(0, alloc_size, vgrnd.params.mmap_prot, vgrnd.params.mmap_flags, -1, 0); in vgetrandom_get_state()
92 munmap(new_block, alloc_size); in vgetrandom_get_state()
/linux/drivers/cpufreq/
H A Dcpufreq_stats.c214 unsigned int alloc_size; in cpufreq_stats_create_table() local
229 alloc_size = count * sizeof(int) + count * sizeof(u64); in cpufreq_stats_create_table()
231 alloc_size += count * count * sizeof(int); in cpufreq_stats_create_table()
234 stats->time_in_state = kzalloc(alloc_size, GFP_KERNEL); in cpufreq_stats_create_table()
/linux/net/bluetooth/
H A Dcoredump.c59 hdev->dump.alloc_size, state); in hci_devcd_update_state()
91 hdev->dump.alloc_size = 0; in hci_devcd_reset()
130 hdev->dump.alloc_size = size; in hci_devcd_alloc()
292 hdev->dump.alloc_size); in hci_devcd_handle_pkt_complete()
311 hdev->dump.alloc_size); in hci_devcd_handle_pkt_abort()
426 hdev->dump.alloc_size); in hci_devcd_timeout()
/linux/drivers/gpu/drm/xe/
H A Dxe_guc_ads.c277 size_t total_size = 0, alloc_size, real_size; in calculate_golden_lrc_size() local
288 alloc_size = PAGE_ALIGN(real_size); in calculate_golden_lrc_size()
289 total_size += alloc_size; in calculate_golden_lrc_size()
583 size_t alloc_size, real_size; in guc_golden_lrc_init() local
599 alloc_size = PAGE_ALIGN(real_size); in guc_golden_lrc_init()
614 addr_ggtt += alloc_size; in guc_golden_lrc_init()
1051 size_t total_size = 0, alloc_size, real_size; in guc_golden_lrc_populate() local
1068 alloc_size = PAGE_ALIGN(real_size); in guc_golden_lrc_populate()
1069 total_size += alloc_size; in guc_golden_lrc_populate()
1074 offset += alloc_size; in guc_golden_lrc_populate()
/linux/drivers/gpu/drm/i915/gt/uc/
H A Dintel_guc_ads.c533 u32 total_size = 0, alloc_size, real_size; in guc_prep_golden_context() local
568 alloc_size = PAGE_ALIGN(real_size); in guc_prep_golden_context()
569 total_size += alloc_size; in guc_prep_golden_context()
590 addr_ggtt += alloc_size; in guc_prep_golden_context()
623 u32 addr_ggtt, total_size = 0, alloc_size, real_size; in guc_init_golden_context() local
644 alloc_size = PAGE_ALIGN(real_size); in guc_init_golden_context()
645 total_size += alloc_size; in guc_init_golden_context()
660 addr_ggtt += alloc_size; in guc_init_golden_context()
664 offset += alloc_size; in guc_init_golden_context()
/linux/drivers/net/ipa/
H A Dgsi_trans.c90 size_t alloc_size; in gsi_trans_pool_init() local
107 alloc_size = size_mul(count + max_alloc - 1, size); in gsi_trans_pool_init()
108 alloc_size = kmalloc_size_roundup(alloc_size); in gsi_trans_pool_init()
109 virt = kzalloc(alloc_size, GFP_KERNEL); in gsi_trans_pool_init()
115 pool->count = alloc_size / size; in gsi_trans_pool_init()
/linux/drivers/cxl/core/
H A Dfeatures.c115 int retrieved, alloc_size, copy_feats; in get_supported_features() local
119 alloc_size = struct_size(mbox_out, ents, max_feats); in get_supported_features()
123 alloc_size = struct_size(mbox_out, ents, remain_feats); in get_supported_features()
129 mbox_in.count = cpu_to_le32(alloc_size); in get_supported_features()
131 memset(mbox_out, 0, alloc_size); in get_supported_features()
136 .size_out = alloc_size, in get_supported_features()

123456