Home
last modified time | relevance | path

Searched refs:buddy (Results 1 – 22 of 22) 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/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/fs/ext4/
H A Dmballoc-test.c609 static void mbt_generate_buddy(struct super_block *sb, void *buddy, in mbt_generate_buddy() argument
617 memset(buddy, 0xff, sb->s_blocksize); in mbt_generate_buddy()
623 bb_h = buddy + sbi->s_mb_offsets[1]; in mbt_generate_buddy()
644 bb = buddy + sbi->s_mb_offsets[order]; in mbt_generate_buddy()
645 bb_h = buddy + sbi->s_mb_offsets[order + 1]; in mbt_generate_buddy()
753 void *buddy, struct ext4_group_info *grp) in test_mb_mark_used_range() argument
774 memset(buddy, 0xff, sb->s_blocksize); in test_mb_mark_used_range()
777 ext4_mb_generate_buddy_test(sb, buddy, bitmap, 0, grp); in test_mb_mark_used_range()
779 KUNIT_ASSERT_EQ(test, memcmp(buddy, e4b->bd_buddy, sb->s_blocksize), in test_mb_mark_used_range()
788 void *bitmap, *buddy; in test_mb_mark_used() local
[all …]
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.c942 struct page *buddy; in __free_one_page() local
962 buddy = find_buddy_page_pfn(page, pfn, order, &buddy_pfn); in __free_one_page()
963 if (!buddy) in __free_one_page()
973 buddy_mt = get_pfnblock_migratetype(buddy, buddy_pfn); in __free_one_page()
985 if (page_is_guard(buddy)) in __free_one_page()
986 clear_page_guard(zone, buddy, order); in __free_one_page()
988 __del_page_from_free_list(buddy, zone, order, buddy_mt); in __free_one_page()
996 change_pageblock_range(buddy, order, migratetype); in __free_one_page()
2099 struct page *buddy; in __move_freepages_block_isolate() local
2115 buddy = pfn_to_page(buddy_pfn); in __move_freepages_block_isolate()
[all …]
H A Ddebug.c57 DEF_PAGETYPE_NAME(buddy),
/linux/include/linux/
H A Dpage-flags.h992 PAGE_TYPE_OPS(Buddy, buddy, buddy)
/linux/Documentation/ABI/testing/
H A Dsysfs-fs-ext437 requests (as a power of 2) where the buddy cache is
/linux/Documentation/admin-guide/mm/
H A Dpagemap.rst115 A free memory block managed by the buddy system allocator.
116 The buddy system organizes free memory in blocks of various orders.
/linux/Documentation/admin-guide/sysctl/
H A Dvm.rst671 buddy allocator will be optimized (7 pages per 2MB HugeTLB page and 4095 pages
674 to the buddy allocator, the vmemmap pages representing that range needs to be
681 of allocation or freeing HugeTLB pages between the HugeTLB pool and the buddy
684 pool to the buddy allocator since the allocation of vmemmap pages could be
688 buddy allocator will not be optimized meaning the extra overhead at allocation
689 time from buddy allocator disappears, whereas already optimized HugeTLB pages
/linux/drivers/gpu/drm/xe/
H A Dxe_svm.c794 struct gpu_buddy *buddy = vram_to_buddy(vr); in xe_svm_populate_devmem_pfn() local
799 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/lib/
H A DKconfig.debug1205 bool "Prefer the buddy CPU hardlockup detector"
1210 Say Y here to prefer the buddy hardlockup detector over the perf one.
1212 With the buddy detector, each CPU uses its softlockup hrtimer
1244 # Both the "perf" and "buddy" hardlockup detectors count hrtimer
/linux/Documentation/admin-guide/
H A Dkernel-parameters.txt1196 buddy allocator. Bigger value increase the probability
4833 poisoning on the buddy allocator, available with
/linux/
H A DMAINTAINERS8963 F: drivers/gpu/buddy.c