Home
last modified time | relevance | path

Searched refs:buddy (Results 1 – 23 of 23) sorted by relevance

/linux/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/
H A Dbuddy.c7 static int hws_buddy_init(struct mlx5hws_buddy_mem *buddy, u32 max_order) in hws_buddy_init() argument
11 buddy->max_order = max_order; in hws_buddy_init()
13 buddy->bitmap = kcalloc(buddy->max_order + 1, in hws_buddy_init()
14 sizeof(*buddy->bitmap), in hws_buddy_init()
16 if (!buddy->bitmap) in hws_buddy_init()
19 buddy->num_free = kcalloc(buddy->max_order + 1, in hws_buddy_init()
20 sizeof(*buddy->num_free), in hws_buddy_init()
22 if (!buddy->num_free) { in hws_buddy_init()
27 for (i = 0; i <= (int)buddy->max_order; ++i) { in hws_buddy_init()
28 s = 1 << (buddy->max_order - i); in hws_buddy_init()
[all …]
H A Dpool.c114 struct mlx5hws_buddy_mem *buddy; in hws_pool_buddy_init() local
116 buddy = mlx5hws_buddy_create(pool->alloc_log_sz); in hws_pool_buddy_init()
117 if (!buddy) { in hws_pool_buddy_init()
126 mlx5hws_buddy_cleanup(buddy); in hws_pool_buddy_init()
127 kfree(buddy); in hws_pool_buddy_init()
131 pool->db.buddy = buddy; in hws_pool_buddy_init()
139 struct mlx5hws_buddy_mem *buddy = pool->db.buddy; in hws_pool_buddy_db_get_chunk() local
141 if (!buddy) { in hws_pool_buddy_db_get_chunk()
146 chunk->offset = mlx5hws_buddy_alloc_mem(buddy, chunk->order); in hws_pool_buddy_db_get_chunk()
156 struct mlx5hws_buddy_mem *buddy; in hws_pool_buddy_db_put_chunk() local
[all …]
/linux/drivers/net/ethernet/mellanox/mlx5/core/steering/sws/
H A Ddr_buddy.c10 int mlx5dr_buddy_init(struct mlx5dr_icm_buddy_mem *buddy, in mlx5dr_buddy_init() argument
15 buddy->max_order = max_order; in mlx5dr_buddy_init()
17 INIT_LIST_HEAD(&buddy->list_node); in mlx5dr_buddy_init()
19 buddy->bitmap = kzalloc_objs(*buddy->bitmap, buddy->max_order + 1); in mlx5dr_buddy_init()
20 buddy->num_free = kzalloc_objs(*buddy->num_free, buddy->max_order + 1); in mlx5dr_buddy_init()
22 if (!buddy->bitmap || !buddy->num_free) in mlx5dr_buddy_init()
27 for (i = 0; i <= buddy->max_order; ++i) { in mlx5dr_buddy_init()
28 unsigned int size = 1 << (buddy->max_order - i); in mlx5dr_buddy_init()
30 buddy->bitmap[i] = bitmap_zalloc(size, GFP_KERNEL); in mlx5dr_buddy_init()
31 if (!buddy->bitmap[i]) in mlx5dr_buddy_init()
[all …]
H A Ddr_icm_pool.c199 static int dr_icm_buddy_get_ste_size(struct mlx5dr_icm_buddy_mem *buddy) in dr_icm_buddy_get_ste_size() argument
212 struct mlx5dr_icm_buddy_mem *buddy = chunk->buddy_mem; in dr_icm_chunk_ste_init() local
213 int ste_size = dr_icm_buddy_get_ste_size(buddy); in dr_icm_chunk_ste_init()
216 chunk->ste_arr = &buddy->ste_arr[index]; in dr_icm_chunk_ste_init()
217 chunk->miss_list = &buddy->miss_list[index]; in dr_icm_chunk_ste_init()
218 chunk->hw_ste_arr = buddy->hw_ste_arr + index * ste_size; in dr_icm_chunk_ste_init()
225 static int dr_icm_buddy_init_ste_cache(struct mlx5dr_icm_buddy_mem *buddy) in dr_icm_buddy_init_ste_cache() argument
228 mlx5dr_icm_pool_chunk_size_to_entries(buddy->pool->max_log_chunk_sz); in dr_icm_buddy_init_ste_cache()
230 buddy->ste_arr = kvzalloc_objs(struct mlx5dr_ste, num_of_entries); in dr_icm_buddy_init_ste_cache()
231 if (!buddy->ste_arr) in dr_icm_buddy_init_ste_cache()
[all …]
H A Dmlx5dr.h185 int mlx5dr_buddy_init(struct mlx5dr_icm_buddy_mem *buddy,
187 void mlx5dr_buddy_cleanup(struct mlx5dr_icm_buddy_mem *buddy);
188 int mlx5dr_buddy_alloc_mem(struct mlx5dr_icm_buddy_mem *buddy,
191 void mlx5dr_buddy_free_mem(struct mlx5dr_icm_buddy_mem *buddy,
/linux/tools/testing/selftests/bpf/libarena/selftests/
H A Dtest_buddy.bpf.c9 extern struct buddy __arena buddy;
33 ret = buddy_init(&buddy); in test_buddy_create()
37 ret = buddy_destroy(&buddy); in test_buddy_create()
52 ret = buddy_init(&buddy); in test_buddy_alloc()
56 mem = buddy_alloc(&buddy, alloc_sizes[i]); in test_buddy_alloc()
58 buddy_destroy(&buddy); in test_buddy_alloc()
62 buddy_destroy(&buddy); in test_buddy_alloc()
75 ret = buddy_init(&buddy); in test_buddy_alloc_free()
80 mem = buddy_alloc(&buddy, alloc_free_sizes[(i * 5) % 8]); in test_buddy_alloc_free()
82 buddy_destroy(&buddy); in test_buddy_alloc_free()
[all …]
H A Dtest_asan_buddy.bpf.c11 extern struct buddy __arena buddy;
26 mem = buddy_alloc(&buddy, alloc_size); in asan_test_buddy_oob_single()
48 buddy_free(&buddy, mem); in asan_test_buddy_oob_single()
80 mem = buddy_alloc(&buddy, alloc_size); in asan_test_buddy_uaf_single()
100 buddy_free(&buddy, mem); in asan_test_buddy_uaf_single()
122 blob = buddy_alloc(&buddy, alloc_size); in asan_test_buddy_blob_single()
141 buddy_free(&buddy, (void __arena *)blob); in asan_test_buddy_blob_single()
160 ret = buddy_init(&buddy); in asan_test_buddy_oob()
172 buddy_destroy(&buddy); in asan_test_buddy_oob()
177 buddy_destroy(&buddy); in asan_test_buddy_oob()
[all …]
/linux/drivers/infiniband/hw/mthca/
H A Dmthca_mr.c42 struct mthca_buddy *buddy; member
84 static u32 mthca_buddy_alloc(struct mthca_buddy *buddy, int order) in mthca_buddy_alloc() argument
90 spin_lock(&buddy->lock); in mthca_buddy_alloc()
92 for (o = order; o <= buddy->max_order; ++o) in mthca_buddy_alloc()
93 if (buddy->num_free[o]) { in mthca_buddy_alloc()
94 m = 1 << (buddy->max_order - o); in mthca_buddy_alloc()
95 seg = find_first_bit(buddy->bits[o], m); in mthca_buddy_alloc()
100 spin_unlock(&buddy->lock); in mthca_buddy_alloc()
104 __clear_bit(seg, buddy->bits[o]); in mthca_buddy_alloc()
105 --buddy->num_free[o]; in mthca_buddy_alloc()
[all …]
/linux/tools/testing/selftests/bpf/libarena/src/
H A Dcommon.bpf.c7 struct buddy __arena buddy; variable
42 buddy_destroy(&buddy); in arena_buddy_reset()
44 return buddy_init(&buddy); in arena_buddy_reset()
50 return buddy_destroy(&buddy); in arena_buddy_destroy()
55 return buddy_alloc(&buddy, size); in arena_malloc()
60 buddy_free(&buddy, ptr); in arena_free()
/linux/drivers/gpu/
H A Dbuddy.c263 struct gpu_buddy_block *buddy; in __gpu_buddy_free() local
265 buddy = __get_buddy(block); in __gpu_buddy_free()
267 if (!gpu_buddy_block_is_free(buddy)) in __gpu_buddy_free()
276 gpu_buddy_block_is_clear(buddy)) in __gpu_buddy_free()
283 rbtree_remove(mm, buddy); in __gpu_buddy_free()
284 mm->free_scoreboard[gpu_buddy_block_order(buddy)]--; in __gpu_buddy_free()
285 if (force_merge && gpu_buddy_block_is_clear(buddy)) in __gpu_buddy_free()
286 mm->clear_avail -= gpu_buddy_block_size(mm, buddy); in __gpu_buddy_free()
292 gpu_block_free(mm, buddy); in __gpu_buddy_free()
322 struct gpu_buddy_block *block, *buddy; in __force_merge() local
[all …]
/linux/fs/ext4/
H A Dmballoc.c718 void *buddy; in __mb_check_buddy() local
725 buddy = mb_find_buddy(e4b, order, &max); in __mb_check_buddy()
726 MB_CHECK_ASSERT(buddy); in __mb_check_buddy()
729 MB_CHECK_ASSERT(buddy != buddy2); in __mb_check_buddy()
735 if (mb_test_bit(i, buddy)) { in __mb_check_buddy()
751 buddy = mb_find_buddy(e4b, 0, &max); in __mb_check_buddy()
753 if (!mb_test_bit(i, buddy)) { in __mb_check_buddy()
765 in_use = mb_test_bit(i, buddy) || mb_test_bit(i + 1, buddy); in __mb_check_buddy()
791 MB_CHECK_ASSERT(mb_test_bit(k + i, buddy)); in __mb_check_buddy()
808 void *buddy, ext4_grpblk_t first, ext4_grpblk_t len, in ext4_mb_mark_free_simple() argument
[all …]
H A Dmballoc.h293 void *buddy, void *bitmap, ext4_group_t group,
/linux/Documentation/gpu/rfc/
H A Di915_gem_lmem.rst20 * Move i915 buddy allocator over to TTM
/linux/Documentation/trace/
H A Devents-kmem.rst56 the per-CPU allocator (high performance) or the buddy allocator.
58 If pages are allocated directly from the buddy allocator, the
/linux/mm/
H A Dpage_alloc.c948 struct page *buddy; in __free_one_page() local
968 buddy = find_buddy_page_pfn(page, pfn, order, &buddy_pfn); in __free_one_page()
969 if (!buddy) in __free_one_page()
979 buddy_mt = get_pfnblock_migratetype(buddy, buddy_pfn); in __free_one_page()
991 if (page_is_guard(buddy)) in __free_one_page()
992 clear_page_guard(zone, buddy, order); in __free_one_page()
994 __del_page_from_free_list(buddy, zone, order, buddy_mt); in __free_one_page()
1002 change_pageblock_range(buddy, order, migratetype); in __free_one_page()
2117 struct page *buddy; in __move_freepages_block_isolate() local
2133 buddy = pfn_to_page(buddy_pfn); in __move_freepages_block_isolate()
[all …]
H A DKconfig669 free pages from the buddy allocator for the purpose of reporting
/linux/Documentation/ABI/testing/
H A Dsysfs-fs-ext437 requests (as a power of 2) where the buddy cache is
/linux/drivers/gpu/drm/xe/
H A Dxe_svm.c800 struct gpu_buddy *buddy = vram_to_buddy(vr); in xe_svm_populate_devmem_pfn() local
809 for (i = 0; i < gpu_buddy_block_size(buddy, block) >> PAGE_SHIFT; ++i) in xe_svm_populate_devmem_pfn()
/linux/Documentation/mm/
H A Dpage_migration.rst159 change until the page was freed back to the buddy. This includes not
/linux/Documentation/RCU/
H A Drcu_dereference.rst63 classic buddy-allocator algorithms.
/linux/lib/
H A DKconfig.debug1162 bool "Prefer the buddy CPU hardlockup detector"
1167 Say Y here to prefer the buddy hardlockup detector over the perf one.
1169 With the buddy detector, each CPU uses its softlockup hrtimer
1201 # Both the "perf" and "buddy" hardlockup detectors count hrtimer
/linux/Documentation/admin-guide/
H A Dkernel-parameters.txt1175 buddy allocator. Bigger value increase the probability
4853 poisoning on the buddy allocator, available with
/linux/
H A DMAINTAINERS9140 F: drivers/gpu/buddy.c