Home
last modified time | relevance | path

Searched refs:buddy (Results 1 – 18 of 18) 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 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/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 Ddebug.c57 DEF_PAGETYPE_NAME(buddy),
/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/RCU/
H A Drcu_dereference.rst63 classic buddy-allocator algorithms.
/linux/Documentation/admin-guide/
H A Dkernel-parameters.txt1172 buddy allocator. Bigger value increase the probability
4846 poisoning on the buddy allocator, available with
/linux/
H A DMAINTAINERS9138 F: drivers/gpu/buddy.c