Home
last modified time | relevance | path

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

12

/Linux-v6.1/drivers/net/ethernet/mellanox/mlx5/core/steering/
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()
18 INIT_LIST_HEAD(&buddy->used_list); in mlx5dr_buddy_init()
19 INIT_LIST_HEAD(&buddy->hot_list); in mlx5dr_buddy_init()
21 buddy->bitmap = kcalloc(buddy->max_order + 1, in mlx5dr_buddy_init()
22 sizeof(*buddy->bitmap), in mlx5dr_buddy_init()
24 buddy->num_free = kcalloc(buddy->max_order + 1, in mlx5dr_buddy_init()
25 sizeof(*buddy->num_free), in mlx5dr_buddy_init()
28 if (!buddy->bitmap || !buddy->num_free) in mlx5dr_buddy_init()
[all …]
Ddr_icm_pool.c168 static int dr_icm_buddy_get_ste_size(struct mlx5dr_icm_buddy_mem *buddy) in dr_icm_buddy_get_ste_size() argument
180 struct mlx5dr_icm_buddy_mem *buddy = chunk->buddy_mem; in dr_icm_chunk_ste_init() local
183 chunk->ste_arr = &buddy->ste_arr[index]; in dr_icm_chunk_ste_init()
184 chunk->miss_list = &buddy->miss_list[index]; in dr_icm_chunk_ste_init()
185 chunk->hw_ste_arr = buddy->hw_ste_arr + in dr_icm_chunk_ste_init()
186 index * dr_icm_buddy_get_ste_size(buddy); in dr_icm_chunk_ste_init()
192 struct mlx5dr_icm_buddy_mem *buddy = chunk->buddy_mem; in dr_icm_chunk_ste_cleanup() local
195 num_of_entries * dr_icm_buddy_get_ste_size(buddy)); in dr_icm_chunk_ste_cleanup()
207 struct mlx5dr_icm_buddy_mem *buddy) in dr_icm_chunk_destroy() argument
211 buddy->used_memory -= mlx5dr_icm_pool_get_chunk_byte_size(chunk); in dr_icm_chunk_destroy()
[all …]
Dmlx5dr.h183 int mlx5dr_buddy_init(struct mlx5dr_icm_buddy_mem *buddy,
185 void mlx5dr_buddy_cleanup(struct mlx5dr_icm_buddy_mem *buddy);
186 int mlx5dr_buddy_alloc_mem(struct mlx5dr_icm_buddy_mem *buddy,
189 void mlx5dr_buddy_free_mem(struct mlx5dr_icm_buddy_mem *buddy,
/Linux-v6.1/drivers/infiniband/hw/mthca/
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-v6.1/arch/arm64/kvm/hyp/nvhe/
Dpage_alloc.c56 struct hyp_page *buddy = __find_buddy_nocheck(pool, p, order); in __find_buddy_avail() local
58 if (!buddy || buddy->order != order || buddy->refcount) in __find_buddy_avail()
61 return buddy; in __find_buddy_avail()
97 struct hyp_page *buddy; in __hyp_attach_page() local
109 buddy = __find_buddy_avail(pool, p, order); in __hyp_attach_page()
110 if (!buddy) in __hyp_attach_page()
114 page_remove_from_list(buddy); in __hyp_attach_page()
115 buddy->order = HYP_NO_ORDER; in __hyp_attach_page()
116 p = min(p, buddy); in __hyp_attach_page()
128 struct hyp_page *buddy; in __hyp_extract_page() local
[all …]
/Linux-v6.1/drivers/net/ethernet/mellanox/mlx4/
Dmr.c46 static u32 mlx4_buddy_alloc(struct mlx4_buddy *buddy, int order) in mlx4_buddy_alloc() argument
52 spin_lock(&buddy->lock); in mlx4_buddy_alloc()
54 for (o = order; o <= buddy->max_order; ++o) in mlx4_buddy_alloc()
55 if (buddy->num_free[o]) { in mlx4_buddy_alloc()
56 m = 1 << (buddy->max_order - o); in mlx4_buddy_alloc()
57 seg = find_first_bit(buddy->bits[o], m); in mlx4_buddy_alloc()
62 spin_unlock(&buddy->lock); in mlx4_buddy_alloc()
66 clear_bit(seg, buddy->bits[o]); in mlx4_buddy_alloc()
67 --buddy->num_free[o]; in mlx4_buddy_alloc()
72 set_bit(seg ^ 1, buddy->bits[o]); in mlx4_buddy_alloc()
[all …]
/Linux-v6.1/mm/
Dzbud.c127 struct list_head buddy; member
138 enum buddy { enum
158 INIT_LIST_HEAD(&zhdr->buddy); in init_zbud_page()
174 static unsigned long encode_handle(struct zbud_header *zhdr, enum buddy bud) in encode_handle()
273 enum buddy bud; in zbud_alloc()
287 struct zbud_header, buddy); in zbud_alloc()
288 list_del(&zhdr->buddy); in zbud_alloc()
316 list_add(&zhdr->buddy, &pool->unbuddied[freechunks]); in zbud_alloc()
319 list_add(&zhdr->buddy, &pool->buddied); in zbud_alloc()
364 list_del(&zhdr->buddy); in zbud_free()
[all …]
Dz3fold.c75 enum buddy { enum
112 struct list_head buddy; member
358 INIT_LIST_HEAD(&zhdr->buddy); in init_z3fold_page()
375 static inline int __idx(struct z3fold_header *zhdr, enum buddy bud) in __idx()
386 enum buddy bud) in __encode_handle()
410 static unsigned long encode_handle(struct z3fold_header *zhdr, enum buddy bud) in encode_handle()
432 static enum buddy handle_to_buddy(unsigned long handle) in handle_to_buddy()
456 WARN_ON(!list_empty(&zhdr->buddy)); in __release_z3fold_page()
468 list_add(&zhdr->buddy, &pool->stale); in __release_z3fold_page()
490 list_del_init(&zhdr->buddy); in release_z3fold_page_locked_list()
[all …]
Dinternal.h271 static inline bool page_is_buddy(struct page *page, struct page *buddy, in page_is_buddy() argument
274 if (!page_is_guard(buddy) && !PageBuddy(buddy)) in page_is_buddy()
277 if (buddy_order(buddy) != order) in page_is_buddy()
284 if (page_zone_id(page) != page_zone_id(buddy)) in page_is_buddy()
287 VM_BUG_ON_PAGE(page_count(buddy) != 0, buddy); in page_is_buddy()
333 struct page *buddy; in find_buddy_page_pfn() local
335 buddy = page + (__buddy_pfn - pfn); in find_buddy_page_pfn()
339 if (page_is_buddy(page, buddy, order)) in find_buddy_page_pfn()
340 return buddy; in find_buddy_page_pfn()
Dpage_isolation.c212 struct page *buddy; in unset_migratetype_isolate() local
230 buddy = find_buddy_page_pfn(page, page_to_pfn(page), in unset_migratetype_isolate()
232 if (buddy && !is_migrate_isolate_page(buddy)) { in unset_migratetype_isolate()
/Linux-v6.1/drivers/gpu/drm/
Ddrm_buddy.c251 struct drm_buddy_block *buddy; in __drm_buddy_free() local
253 buddy = __get_buddy(block); in __drm_buddy_free()
255 if (!drm_buddy_block_is_free(buddy)) in __drm_buddy_free()
258 list_del(&buddy->link); in __drm_buddy_free()
261 drm_block_free(mm, buddy); in __drm_buddy_free()
318 struct drm_buddy_block *buddy; in alloc_range_bias() local
381 buddy = __get_buddy(block); in alloc_range_bias()
382 if (buddy && in alloc_range_bias()
384 drm_buddy_block_is_free(buddy))) in alloc_range_bias()
459 struct drm_buddy_block *buddy; in __alloc_range() local
[all …]
/Linux-v6.1/drivers/gpu/drm/tests/
Ddrm_buddy_test.c47 struct drm_buddy_block *block, bool buddy) in __dump_block() argument
52 drm_buddy_block_size(mm, block), !block->parent, buddy); in __dump_block()
58 struct drm_buddy_block *buddy; in dump_block() local
62 buddy = drm_get_buddy(block); in dump_block()
63 if (buddy) in dump_block()
64 __dump_block(test, mm, buddy, true); in dump_block()
70 struct drm_buddy_block *buddy; in check_block() local
112 buddy = drm_get_buddy(block); in check_block()
114 if (!buddy && block->parent) { in check_block()
119 if (buddy) { in check_block()
[all …]
/Linux-v6.1/arch/mips/include/asm/
Dpgtable.h133 pte_t *buddy = ptep_buddy(ptep); local
138 if (pte_none(*buddy)) {
140 buddy->pte_low |= _PAGE_GLOBAL;
141 buddy->pte_high |= _PAGE_GLOBAL;
179 pte_t *buddy = ptep_buddy(ptep); local
185 cmpxchg64(&buddy->pte, 0, _PAGE_GLOBAL);
187 cmpxchg(&buddy->pte, 0, _PAGE_GLOBAL);
/Linux-v6.1/arch/loongarch/include/asm/
Dpgtable.h271 pte_t *buddy = ptep_buddy(ptep); in set_pte() local
293 : [buddy] "+m" (buddy->pte), [tmp] "=&r" (tmp) in set_pte()
296 if (pte_none(*buddy)) in set_pte()
297 pte_val(*buddy) = pte_val(*buddy) | _PAGE_GLOBAL; in set_pte()
/Linux-v6.1/drivers/staging/r8188eu/core/
Drtw_pwrctrl.c87 struct adapter *buddy = adapter->pbuddy_adapter; in rtw_pwr_unassociated_idle() local
104 if (buddy) { in rtw_pwr_unassociated_idle()
105 struct mlme_priv *b_pmlmepriv = &buddy->mlmepriv; in rtw_pwr_unassociated_idle()
106 struct wifidirect_info *b_pwdinfo = &buddy->wdinfo; in rtw_pwr_unassociated_idle()
/Linux-v6.1/drivers/dma-buf/heaps/
DKconfig6 is backed by pages from the buddy allocator. If in doubt, say Y.
/Linux-v6.1/fs/ext4/
Dmballoc.c683 void *buddy; in __mb_check_buddy() local
690 buddy = mb_find_buddy(e4b, order, &max); in __mb_check_buddy()
691 MB_CHECK_ASSERT(buddy); in __mb_check_buddy()
694 MB_CHECK_ASSERT(buddy != buddy2); in __mb_check_buddy()
700 if (mb_test_bit(i, buddy)) { in __mb_check_buddy()
725 buddy = mb_find_buddy(e4b, 0, &max); in __mb_check_buddy()
727 if (!mb_test_bit(i, buddy)) { in __mb_check_buddy()
755 MB_CHECK_ASSERT(mb_test_bit(k + i, buddy)); in __mb_check_buddy()
773 void *buddy, ext4_grpblk_t first, ext4_grpblk_t len, in ext4_mb_mark_free_simple() argument
801 buddy + sbi->s_mb_offsets[min]); in ext4_mb_mark_free_simple()
[all …]
/Linux-v6.1/Documentation/mm/
Dvmemmap_dedup.rst29 to the buddy allocator for other uses.
132 7 pages to the buddy allocator.
159 When a HugeTLB is freed to the buddy system, we should allocate 7 pages for
174 Notice: The head vmemmap page is not freed to the buddy allocator and all
/Linux-v6.1/Documentation/gpu/rfc/
Di915_gem_lmem.rst20 * Move i915 buddy allocator over to TTM
/Linux-v6.1/Documentation/trace/
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-v6.1/drivers/staging/rtl8723bs/core/
Drtw_pwrctrl.c92 struct adapter *buddy = adapter->pbuddy_adapter; in rtw_pwr_unassociated_idle() local
112 if (buddy) { in rtw_pwr_unassociated_idle()
113 struct mlme_priv *b_pmlmepriv = &(buddy->mlmepriv); in rtw_pwr_unassociated_idle()
/Linux-v6.1/fs/jfs/
Djfs_dmap.c2737 int budsz, buddy; in dbJoin() local
2767 buddy = leafno ^ budsz; in dbJoin()
2772 if (newval > leaf[buddy]) in dbJoin()
2776 if (newval < leaf[buddy]) in dbJoin()
2787 if (leafno < buddy) { in dbJoin()
2790 dbAdjTree(tp, buddy, NOFREE); in dbJoin()
2796 leafno = buddy; in dbJoin()
/Linux-v6.1/Documentation/admin-guide/mm/
Dpagemap.rst100 A free memory block managed by the buddy system allocator.
101 The buddy system organizes free memory in blocks of various orders.
/Linux-v6.1/Documentation/ABI/testing/
Dsysfs-fs-ext437 requests (as a power of 2) where the buddy cache is
/Linux-v6.1/Documentation/admin-guide/sysctl/
Dvm.rst575 buddy allocator will be optimized (7 pages per 2MB HugeTLB page and 4095 pages
578 to the buddy allocator, the vmemmap pages representing that range needs to be
585 of allocation or freeing HugeTLB pages between the HugeTLB pool and the buddy
588 pool to the buddy allocator since the allocation of vmemmap pages could be
592 buddy allocator will not be optimized meaning the extra overhead at allocation
593 time from buddy allocator disappears, whereas already optimized HugeTLB pages

12