Home
last modified time | relevance | path

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

12

/linux-6.15/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/
H A Dbuddy.c13 buddy->bitmap = kcalloc(buddy->max_order + 1, 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()
22 if (!buddy->num_free) { in hws_buddy_init()
37 bitmap_set(buddy->bitmap[buddy->max_order], 0, 1); in hws_buddy_init()
38 buddy->num_free[buddy->max_order] = 1; in hws_buddy_init()
49 kfree(buddy->bitmap); in hws_buddy_init()
57 buddy = kzalloc(sizeof(*buddy), GFP_KERNEL); in mlx5hws_buddy_create()
58 if (!buddy) in mlx5hws_buddy_create()
64 return buddy; in mlx5hws_buddy_create()
[all …]
H A Dpool.c130 struct mlx5hws_buddy_mem *buddy; in hws_pool_buddy_db_put_chunk() local
133 if (!buddy) { in hws_pool_buddy_db_put_chunk()
149 if (buddy) in hws_pool_buddy_get_next_buddy()
150 return buddy; in hws_pool_buddy_get_next_buddy()
155 if (!buddy) { in hws_pool_buddy_get_next_buddy()
164 mlx5hws_buddy_cleanup(buddy); in hws_pool_buddy_get_next_buddy()
170 return buddy; in hws_pool_buddy_get_next_buddy()
191 if (!buddy) { in hws_pool_buddy_get_mem_chunk()
247 if (buddy) { in hws_pool_buddy_db_uninit()
248 mlx5hws_buddy_cleanup(buddy); in hws_pool_buddy_db_uninit()
[all …]
H A Dbuddy.h15 void mlx5hws_buddy_cleanup(struct mlx5hws_buddy_mem *buddy);
17 int mlx5hws_buddy_alloc_mem(struct mlx5hws_buddy_mem *buddy, u32 order);
19 void mlx5hws_buddy_free_mem(struct mlx5hws_buddy_mem *buddy, u32 seg, u32 order);
/linux-6.15/drivers/net/ethernet/mellanox/mlx5/core/steering/sws/
H A Ddr_buddy.c19 buddy->bitmap = kcalloc(buddy->max_order + 1, in mlx5dr_buddy_init()
20 sizeof(*buddy->bitmap), in mlx5dr_buddy_init()
22 buddy->num_free = kcalloc(buddy->max_order + 1, in mlx5dr_buddy_init()
26 if (!buddy->bitmap || !buddy->num_free) in mlx5dr_buddy_init()
35 if (!buddy->bitmap[i]) in mlx5dr_buddy_init()
43 bitmap_set(buddy->bitmap[buddy->max_order], 0, 1); in mlx5dr_buddy_init()
45 buddy->num_free[buddy->max_order] = 1; in mlx5dr_buddy_init()
54 kfree(buddy->num_free); in mlx5dr_buddy_init()
55 kfree(buddy->bitmap); in mlx5dr_buddy_init()
68 kfree(buddy->num_free); in mlx5dr_buddy_cleanup()
[all …]
H A Ddr_icm_pool.c232 if (!buddy->ste_arr) in dr_icm_buddy_init_ste_cache()
240 if (!buddy->hw_ste_arr) in dr_icm_buddy_init_ste_cache()
244 if (!buddy->miss_list) in dr_icm_buddy_init_ste_cache()
252 kvfree(buddy->ste_arr); in dr_icm_buddy_init_ste_cache()
258 kvfree(buddy->ste_arr); in dr_icm_buddy_cleanup_ste_cache()
272 buddy = kvzalloc(sizeof(*buddy), GFP_KERNEL); in dr_icm_buddy_create()
273 if (!buddy) in dr_icm_buddy_create()
279 buddy->icm_mr = icm_mr; in dr_icm_buddy_create()
280 buddy->pool = pool; in dr_icm_buddy_create()
298 kvfree(buddy); in dr_icm_buddy_create()
[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-6.15/drivers/infiniband/hw/mthca/
H A Dmthca_mr.c105 --buddy->num_free[o]; in mthca_buddy_alloc()
147 buddy->bits = kcalloc(buddy->max_order + 1, sizeof(long *), in mthca_buddy_init()
149 buddy->num_free = kcalloc((buddy->max_order + 1), sizeof *buddy->num_free, in mthca_buddy_init()
151 if (!buddy->bits || !buddy->num_free) in mthca_buddy_init()
155 buddy->bits[i] = bitmap_zalloc(1 << (buddy->max_order - i), in mthca_buddy_init()
157 if (!buddy->bits[i]) in mthca_buddy_init()
161 __set_bit(0, buddy->bits[buddy->max_order]); in mthca_buddy_init()
162 buddy->num_free[buddy->max_order] = 1; in mthca_buddy_init()
171 kfree(buddy->bits); in mthca_buddy_init()
184 kfree(buddy->bits); in mthca_buddy_cleanup()
[all …]
/linux-6.15/arch/arm64/kvm/hyp/nvhe/
H A Dpage_alloc.c58 if (!buddy || buddy->order != order || buddy->refcount) in __find_buddy_avail()
61 return buddy; in __find_buddy_avail()
98 struct hyp_page *buddy; in __hyp_attach_page() local
114 buddy = __find_buddy_avail(pool, p, order); in __hyp_attach_page()
115 if (!buddy) in __hyp_attach_page()
119 page_remove_from_list(buddy); in __hyp_attach_page()
120 buddy->order = HYP_NO_ORDER; in __hyp_attach_page()
121 p = min(p, buddy); in __hyp_attach_page()
134 struct hyp_page *buddy; in __hyp_extract_page() local
146 buddy->order = p->order; in __hyp_extract_page()
[all …]
/linux-6.15/drivers/net/ethernet/mellanox/mlx4/
H A Dmr.c52 spin_lock(&buddy->lock); in mlx4_buddy_alloc()
67 --buddy->num_free[o]; in mlx4_buddy_alloc()
73 ++buddy->num_free[o]; in mlx4_buddy_alloc()
109 buddy->bits = kcalloc(buddy->max_order + 1, sizeof(long *), in mlx4_buddy_init()
111 buddy->num_free = kcalloc(buddy->max_order + 1, sizeof(*buddy->num_free), in mlx4_buddy_init()
113 if (!buddy->bits || !buddy->num_free) in mlx4_buddy_init()
119 if (!buddy->bits[i]) in mlx4_buddy_init()
123 set_bit(0, buddy->bits[buddy->max_order]); in mlx4_buddy_init()
124 buddy->num_free[buddy->max_order] = 1; in mlx4_buddy_init()
133 kfree(buddy->bits); in mlx4_buddy_init()
[all …]
/linux-6.15/drivers/gpu/drm/
H A Ddrm_buddy.c130 struct drm_buddy_block *buddy; in __drm_buddy_free() local
132 buddy = __get_buddy(block); in __drm_buddy_free()
150 list_del(&buddy->link); in __drm_buddy_free()
155 drm_block_free(mm, buddy); in __drm_buddy_free()
196 buddy = __get_buddy(block); in __force_merge()
208 if (prev == buddy) in __force_merge()
489 struct drm_buddy_block *buddy; in __alloc_range_bias() local
564 buddy = __get_buddy(block); in __alloc_range_bias()
565 if (buddy && in __alloc_range_bias()
768 buddy = __get_buddy(block); in __alloc_range()
[all …]
/linux-6.15/fs/ext4/
H A Dmballoc-test.c612 memset(buddy, 0xff, sb->s_blocksize); in mbt_generate_buddy()
618 bb_h = buddy + sbi->s_mb_offsets[1]; in mbt_generate_buddy()
639 bb = buddy + sbi->s_mb_offsets[order]; in mbt_generate_buddy()
769 memset(buddy, 0xff, sb->s_blocksize); in test_mb_mark_used_range()
783 void *bitmap, *buddy; in test_mb_mark_used() local
796 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, buddy); in test_mb_mark_used()
808 ranges[i].len, bitmap, buddy, grp); in test_mb_mark_used()
832 memset(buddy, 0xff, sb->s_blocksize); in test_mb_free_blocks_range()
847 void *bitmap, *buddy; in test_mb_free_blocks() local
861 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, buddy); in test_mb_free_blocks()
[all …]
H A Dmballoc.c695 void *buddy; in __mb_check_buddy() local
703 MB_CHECK_ASSERT(buddy); in __mb_check_buddy()
712 if (mb_test_bit(i, buddy)) { in __mb_check_buddy()
739 if (!mb_test_bit(i, buddy)) { in __mb_check_buddy()
1243 void *buddy; in mb_regenerate_buddy() local
1847 while (buddy) { in mb_buddy_mark_free()
1895 buddy = buddy2; in mb_buddy_mark_free()
1991 void *buddy; in mb_find_extent() local
1997 BUG_ON(buddy == NULL); in mb_find_extent()
2055 void *buddy; in mb_mark_used() local
[all …]
/linux-6.15/arch/mips/include/asm/
H A Dpgtable.h130 pte_t *buddy = ptep_buddy(ptep); local
135 if (pte_none(*buddy)) {
137 buddy->pte_low |= _PAGE_GLOBAL;
138 buddy->pte_high |= _PAGE_GLOBAL;
176 pte_t *buddy = ptep_buddy(ptep); local
182 cmpxchg64(&buddy->pte, 0, _PAGE_GLOBAL);
184 cmpxchg(&buddy->pte, 0, _PAGE_GLOBAL);
/linux-6.15/mm/
H A Dinternal.h614 static inline bool page_is_buddy(struct page *page, struct page *buddy, in page_is_buddy() argument
617 if (!page_is_guard(buddy) && !PageBuddy(buddy)) in page_is_buddy()
620 if (buddy_order(buddy) != order) in page_is_buddy()
627 if (page_zone_id(page) != page_zone_id(buddy)) in page_is_buddy()
630 VM_BUG_ON_PAGE(page_count(buddy) != 0, buddy); in page_is_buddy()
676 struct page *buddy; in find_buddy_page_pfn() local
678 buddy = page + (__buddy_pfn - pfn); in find_buddy_page_pfn()
682 if (page_is_buddy(page, buddy, order)) in find_buddy_page_pfn()
683 return buddy; in find_buddy_page_pfn()
H A Dpage_isolation.c218 struct page *buddy; in unset_migratetype_isolate() local
236 buddy = find_buddy_page_pfn(page, page_to_pfn(page), in unset_migratetype_isolate()
238 if (buddy && !is_migrate_isolate_page(buddy)) { in unset_migratetype_isolate()
H A Dpage_alloc.c805 struct page *buddy; in __free_one_page() local
826 if (!buddy) in __free_one_page()
836 buddy_mt = get_pfnblock_migratetype(buddy, buddy_pfn); in __free_one_page()
848 if (page_is_guard(buddy)) in __free_one_page()
849 clear_page_guard(zone, buddy, order); in __free_one_page()
859 set_pageblock_migratetype(buddy, migratetype); in __free_one_page()
1952 struct page *buddy = pfn_to_page(pfn); in move_freepages_block_isolate() local
1953 int order = buddy_order(buddy); in move_freepages_block_isolate()
1955 del_page_from_free_list(buddy, zone, order, in move_freepages_block_isolate()
1956 get_pfnblock_migratetype(buddy, pfn)); in move_freepages_block_isolate()
[all …]
H A Ddebug.c57 DEF_PAGETYPE_NAME(buddy),
/linux-6.15/drivers/dma-buf/heaps/
H A DKconfig6 is backed by pages from the buddy allocator. If in doubt, say Y.
/linux-6.15/Documentation/mm/
H A Dvmemmap_dedup.rst30 to the buddy allocator for other uses.
133 7 pages to the buddy allocator.
160 When a HugeTLB is freed to the buddy system, we should allocate 7 pages for
175 Notice: The head vmemmap page is not freed to the buddy allocator and all
H A Dphysical_memory.rst363 falling back to the buddy allocator. Pages are transferred between the Per-CPU
364 Pagesets and the global free areas (managed by the buddy allocator) in batches.
365 This minimizes the overhead of frequent interactions with the global buddy
444 calculate the number of elements the Per-CPU Pagesets obtain from the buddy
446 to decide if the Per-CPU Pagesets return pages to the buddy allocator in page
461 The present pages managed by the buddy system, which is calculated as:
467 frees pages into buddy system.
515 which is a power of two. The buddy allocator uses this structure to manage
520 with its buddy to form a larger block. It is initialized by
/linux-6.15/Documentation/gpu/rfc/
H A Di915_gem_lmem.rst20 * Move i915 buddy allocator over to TTM
/linux-6.15/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-6.15/drivers/staging/rtl8723bs/core/
H A Drtw_pwrctrl.c88 struct adapter *buddy = adapter->pbuddy_adapter; in rtw_pwr_unassociated_idle() local
108 if (buddy) { in rtw_pwr_unassociated_idle()
109 struct mlme_priv *b_pmlmepriv = &(buddy->mlmepriv); in rtw_pwr_unassociated_idle()
/linux-6.15/fs/jfs/
H A Djfs_dmap.c2760 int budsz, buddy; in dbJoin() local
2790 buddy = leafno ^ budsz; in dbJoin()
2795 if (newval > leaf[buddy]) in dbJoin()
2799 if (newval < leaf[buddy]) in dbJoin()
2810 if (leafno < buddy) { in dbJoin()
2813 dbAdjTree(tp, buddy, NOFREE, is_ctl); in dbJoin()
2819 leafno = buddy; in dbJoin()
/linux-6.15/Documentation/ABI/testing/
H A Dsysfs-fs-ext437 requests (as a power of 2) where the buddy cache is

12