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

/linux-master/drivers/net/ethernet/mellanox/mlx5/core/steering/
H A Ddr_buddy.c10 int mlx5dr_buddy_init(struct mlx5dr_icm_buddy_mem *buddy, argument
15 buddy->max_order = max_order;
17 INIT_LIST_HEAD(&buddy->list_node);
19 buddy->bitmap = kcalloc(buddy->max_order + 1,
20 sizeof(*buddy->bitmap),
22 buddy->num_free = kcalloc(buddy->max_order + 1,
23 sizeof(*buddy->num_free),
26 if (!buddy
59 mlx5dr_buddy_cleanup(struct mlx5dr_icm_buddy_mem *buddy) argument
72 dr_buddy_find_free_seg(struct mlx5dr_icm_buddy_mem *buddy, unsigned int start_order, unsigned int *segment, unsigned int *order) argument
119 mlx5dr_buddy_alloc_mem(struct mlx5dr_icm_buddy_mem *buddy, unsigned int order, unsigned int *segment) argument
150 mlx5dr_buddy_free_mem(struct mlx5dr_icm_buddy_mem *buddy, unsigned int seg, unsigned int order) argument
[all...]
H A Ddr_icm_pool.c24 struct mutex mutex; /* protect the ICM pool and ICM buddy */
199 static int dr_icm_buddy_get_ste_size(struct mlx5dr_icm_buddy_mem *buddy) argument
212 struct mlx5dr_icm_buddy_mem *buddy = chunk->buddy_mem; local
213 int ste_size = dr_icm_buddy_get_ste_size(buddy);
216 chunk->ste_arr = &buddy->ste_arr[index];
217 chunk->miss_list = &buddy->miss_list[index];
218 chunk->hw_ste_arr = buddy->hw_ste_arr + index * ste_size;
225 static int dr_icm_buddy_init_ste_cache(struct mlx5dr_icm_buddy_mem *buddy) argument
228 mlx5dr_icm_pool_chunk_size_to_entries(buddy->pool->max_log_chunk_sz);
230 buddy
256 dr_icm_buddy_cleanup_ste_cache(struct mlx5dr_icm_buddy_mem *buddy) argument
265 struct mlx5dr_icm_buddy_mem *buddy; local
304 dr_icm_buddy_destroy(struct mlx5dr_icm_buddy_mem *buddy) argument
367 struct mlx5dr_icm_buddy_mem *buddy, *tmp_buddy; local
386 dr_icm_handle_buddies_get_mem(struct mlx5dr_icm_pool *pool, enum mlx5dr_icm_chunk_size chunk_size, struct mlx5dr_icm_buddy_mem **buddy, unsigned int *seg) argument
439 struct mlx5dr_icm_buddy_mem *buddy; local
469 struct mlx5dr_icm_buddy_mem *buddy = chunk->buddy_mem; local
566 struct mlx5dr_icm_buddy_mem *buddy, *tmp_buddy; local
[all...]
H A Dmlx5dr.h171 /* buddy functions & structure */
192 int mlx5dr_buddy_init(struct mlx5dr_icm_buddy_mem *buddy,
194 void mlx5dr_buddy_cleanup(struct mlx5dr_icm_buddy_mem *buddy);
195 int mlx5dr_buddy_alloc_mem(struct mlx5dr_icm_buddy_mem *buddy,
198 void mlx5dr_buddy_free_mem(struct mlx5dr_icm_buddy_mem *buddy,
/linux-master/drivers/infiniband/hw/mthca/
H A Dmthca_mr.c42 struct mthca_buddy *buddy; member in struct:mthca_mtt
84 static u32 mthca_buddy_alloc(struct mthca_buddy *buddy, int order) argument
90 spin_lock(&buddy->lock);
92 for (o = order; o <= buddy->max_order; ++o)
93 if (buddy->num_free[o]) {
94 m = 1 << (buddy->max_order - o);
95 seg = find_first_bit(buddy->bits[o], m);
100 spin_unlock(&buddy->lock);
104 __clear_bit(seg, buddy->bits[o]);
105 --buddy
121 mthca_buddy_free(struct mthca_buddy *buddy, u32 seg, int order) argument
140 mthca_buddy_init(struct mthca_buddy *buddy, int max_order) argument
177 mthca_buddy_cleanup(struct mthca_buddy *buddy) argument
188 mthca_alloc_mtt_range(struct mthca_dev *dev, int order, struct mthca_buddy *buddy) argument
206 __mthca_alloc_mtt(struct mthca_dev *dev, int size, struct mthca_buddy *buddy) argument
[all...]
/linux-master/arch/arm64/kvm/hyp/nvhe/
H A Dpage_alloc.c13 * Index the hyp_vmemmap to find a potential buddy page, but make no assumption
16 * Example buddy-tree for a 4-pages physically contiguous pool:
51 /* Find a buddy page currently available for allocation */
56 struct hyp_page *buddy = __find_buddy_nocheck(pool, p, order); local
58 if (!buddy || buddy->order != order || buddy->refcount)
61 return buddy;
98 struct hyp_page *buddy; local
114 buddy
134 struct hyp_page *buddy; local
[all...]
/linux-master/drivers/net/ethernet/mellanox/mlx4/
H A Dmr.c46 static u32 mlx4_buddy_alloc(struct mlx4_buddy *buddy, int order) argument
52 spin_lock(&buddy->lock);
54 for (o = order; o <= buddy->max_order; ++o)
55 if (buddy->num_free[o]) {
56 m = 1 << (buddy->max_order - o);
57 seg = find_first_bit(buddy->bits[o], m);
62 spin_unlock(&buddy->lock);
66 clear_bit(seg, buddy->bits[o]);
67 --buddy->num_free[o];
72 set_bit(seg ^ 1, buddy
83 mlx4_buddy_free(struct mlx4_buddy *buddy, u32 seg, int order) argument
102 mlx4_buddy_init(struct mlx4_buddy *buddy, int max_order) argument
139 mlx4_buddy_cleanup(struct mlx4_buddy *buddy) argument
[all...]
/linux-master/mm/
H A Dzbud.c10 * to what its name may suggest, zbud is not a buddy allocator, but rather an
19 * single memory page called a "zbud page". The first buddy is "left
20 * justified" at the beginning of the zbud page, and the last buddy is "right
22 * buddy is freed, the freed buddy space, coalesced with whatever slack space
81 * @unbuddied: array of lists tracking zbud pages that only contain one buddy;
107 * @buddy: links the zbud page into the unbuddied/buddied lists in the pool
108 * @first_chunks: the size of the first buddy in chunks, 0 if free
109 * @last_chunks: the size of the last buddy in chunks, 0 if free
112 struct list_head buddy; member in struct:zbud_header
121 enum buddy { enum
[all...]
H A Dz3fold.c72 enum buddy { enum
94 * @buddy: links the z3fold page into the relevant list in the
99 * @slots: pointer to the structure holding buddy slots
102 * @first_chunks: the size of the first buddy in chunks, 0 if free
103 * @middle_chunks: the size of the middle buddy in chunks, 0 if free
104 * @last_chunks: the size of the last buddy in chunks, 0 if free
109 struct list_head buddy; member in struct:z3fold_header
344 INIT_LIST_HEAD(&zhdr->buddy);
361 static inline int __idx(struct z3fold_header *zhdr, enum buddy bud)
367 * Encodes the handle of a particular buddy withi
1180 enum buddy buddy; local
1224 enum buddy buddy; local
[all...]
H A Dpage_isolation.c110 * The HWPoisoned page may be not in buddy system, and
212 struct page *buddy; local
222 * it is possible that there is free buddy page.
230 buddy = find_buddy_page_pfn(page, page_to_pfn(page),
232 if (buddy && !is_migrate_isolate_page(buddy)) {
H A Dinternal.h357 * This function returns the order of a free page in the buddy system. In
384 * This function checks whether a page is free && is the buddy
385 * we can coalesce a page and its buddy if
386 * (a) the buddy is not in a hole (check before calling!) &&
387 * (b) the buddy is in the buddy system &&
388 * (c) a page and its buddy have the same order &&
389 * (d) a page and its buddy are in the same zone.
391 * For recording whether a page is in the buddy system, we set PageBuddy.
396 static inline bool page_is_buddy(struct page *page, struct page *buddy, argument
458 struct page *buddy; local
[all...]
H A Dpage_alloc.c717 * If this is not the largest possible page, check if the buddy
742 * Freeing function for a buddy system allocator.
744 * The concept of a buddy system is to maintain direct-mapped table
759 * If a block is freed, and its buddy is also free, then this
773 struct page *buddy; local
793 buddy = find_buddy_page_pfn(page, pfn, order, &buddy_pfn);
794 if (!buddy)
804 int buddy_mt = get_pfnblock_migratetype(buddy, buddy_pfn);
813 * Our buddy is free or it is CONFIG_DEBUG_PAGEALLOC guard page,
816 if (page_is_guard(buddy))
[all...]
/linux-master/fs/ext4/
H A Dmballoc-test.c580 static void mbt_generate_buddy(struct super_block *sb, void *buddy, argument
588 memset(buddy, 0xff, sb->s_blocksize);
594 bb_h = buddy + sbi->s_mb_offsets[1];
615 bb = buddy + sbi->s_mb_offsets[order];
616 bb_h = buddy + sbi->s_mb_offsets[order + 1];
724 void *buddy, struct ext4_group_info *grp)
745 memset(buddy, 0xff, sb->s_blocksize);
748 ext4_mb_generate_buddy(sb, buddy, bitmap, 0, grp);
750 KUNIT_ASSERT_EQ(test, memcmp(buddy, e4b->bd_buddy, sb->s_blocksize),
759 void *bitmap, *buddy; local
722 test_mb_mark_used_range(struct kunit *test, struct ext4_buddy *e4b, ext4_grpblk_t start, ext4_grpblk_t len, void *bitmap, void *buddy, struct ext4_group_info *grp) argument
789 test_mb_free_blocks_range(struct kunit *test, struct ext4_buddy *e4b, ext4_grpblk_t start, ext4_grpblk_t len, void *bitmap, void *buddy, struct ext4_group_info *grp) argument
822 void *bitmap, *buddy; local
[all...]
H A Dmballoc.c38 * - mb_mark_used() may allocate chunk right after splitting buddy
92 * prealloc then we look at the buddy cache. The buddy cache is represented
94 * mapped to the buddy and bitmap information regarding different
95 * groups. The buddy information is attached to buddy cache inode so that
98 * block bitmap and buddy information. The information are stored in the
102 * [ group 0 bitmap][ group 0 buddy] [group 1][ group 1]...
105 * one block each for bitmap and buddy information. So for each group we
110 * The buddy cach
695 void *buddy; local
785 ext4_mb_mark_free_simple(struct super_block *sb, void *buddy, ext4_grpblk_t first, ext4_grpblk_t len, struct ext4_group_info *grp) argument
1180 ext4_mb_generate_buddy(struct super_block *sb, void *buddy, void *bitmap, ext4_group_t group, struct ext4_group_info *grp) argument
1239 void *buddy; local
1837 void *buddy = mb_find_buddy(e4b, order, &max); local
1983 void *buddy; local
2048 void *buddy; local
2391 void *buddy; local
[all...]
/linux-master/drivers/gpu/drm/
H A Ddrm_buddy.c88 * @mm: DRM buddy manager to initialize
183 * @mm: DRM buddy manager to free
247 * drm_get_buddy - get buddy address
249 * @block: DRM buddy block
251 * Returns the corresponding buddy block for @block, or NULL
269 struct drm_buddy_block *buddy; local
271 buddy = __get_buddy(block);
273 if (!drm_buddy_block_is_free(buddy))
276 list_del(&buddy->link);
279 drm_block_free(mm, buddy);
337 struct drm_buddy_block *buddy; local
497 struct drm_buddy_block *buddy; local
[all...]
/linux-master/arch/mips/include/asm/
H A Dpgtable.h130 pte_t *buddy = ptep_buddy(ptep); local
132 * Make sure the buddy is global too (if it's !none,
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
178 * Make sure the buddy is global too (if it's !none,
182 cmpxchg64(&buddy->pte, 0, _PAGE_GLOBAL);
184 cmpxchg(&buddy->pte, 0, _PAGE_GLOBAL);
/linux-master/arch/loongarch/include/asm/
H A Dpgtable.h319 pte_t *buddy = ptep_buddy(ptep); local
321 * Make sure the buddy is global too (if it's !none,
333 "1:" __LL "%[tmp], %[buddy] \n"
336 __SC "%[tmp], %[buddy] \n"
341 : [buddy] "+m" (buddy->pte), [tmp] "=&r" (tmp)
344 if (pte_none(*buddy))
345 pte_val(*buddy) = pte_val(*buddy) | _PAGE_GLOBAL;
/linux-master/include/trace/events/
H A Dmmflags.h142 DEF_PAGETYPE_NAME(buddy)
H A Dext4.h1047 __field( __u16, buddy )
1071 __entry->buddy = ac->ac_buddy;
1089 __entry->buddy ? 1 << __entry->buddy : 0)
/linux-master/drivers/staging/rtl8723bs/core/
H A Drtw_pwrctrl.c92 struct adapter *buddy = adapter->pbuddy_adapter; local
111 /* consider buddy, if exist */
112 if (buddy) {
113 struct mlme_priv *b_pmlmepriv = &(buddy->mlmepriv);
/linux-master/fs/jfs/
H A Djfs_dmap.c110 * buddy table
112 * table used for determining buddy sizes within characters of
115 * binary buddy of free bits within the character.
1303 * part) of a larger binary buddy system, causing the dmap
1360 * part) of a larger binary buddy system.
2102 * the freed blocks to become part of a larger binary buddy
2123 * of the binary buddy system described by the dmap's dmtree
2187 * to setting the leaf value to the binary buddy max
2270 * of the binary buddy system described by the dmap's dmtree
2316 * buddy syste
2770 int budsz, buddy; local
[all...]
/linux-master/include/linux/
H A Dpage-flags.h177 /* Only valid for buddy pages. Used to track pages that are reported */
1000 * PageBuddy() indicates that the page is free and in the buddy system
1003 PAGE_TYPE_OPS(Buddy, buddy, buddy)
1013 * putting them back to the buddy, it can do so via the memory notifier by
1020 * buddy via online_page_callback_t.
/linux-master/arch/x86/kvm/vmx/
H A Dvmx.h381 struct loaded_vmcs *buddy);
H A Dvmx.c1410 struct loaded_vmcs *buddy)
1445 if (!buddy || WARN_ON_ONCE(buddy->vmcs != prev))
1409 vmx_vcpu_load_vmcs(struct kvm_vcpu *vcpu, int cpu, struct loaded_vmcs *buddy) argument

Completed in 355 milliseconds