Home
last modified time | relevance | path

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

12

/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/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); in __find_buddy_avail() local
58 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 in __hyp_attach_page()
134 struct hyp_page *buddy; __hyp_extract_page() local
[all...]
/linux/drivers/net/ethernet/mellanox/mlx4/
H A 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/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
121 enum buddy { global() enum
[all...]
H A Dz3fold.c72 enum buddy { enum
109 struct list_head buddy; member
344 INIT_LIST_HEAD(&zhdr->buddy); in init_z3fold_page()
361 static inline int __idx(struct z3fold_header *zhdr, enum buddy bud) in __idx()
373 enum buddy bud) in __encode_handle()
397 static unsigned long encode_handle(struct z3fold_header *zhdr, enum buddy bud) in encode_handle()
419 static enum buddy handle_to_buddy(unsigned long handle) in handle_to_buddy()
443 WARN_ON(!list_empty(&zhdr->buddy)); in __release_z3fold_page()
453 list_add(&zhdr->buddy, &pool->stale); in __release_z3fold_page()
475 list_del_init(&zhdr->buddy); in release_z3fold_page_locked_list()
[all …]
H A Dinternal.h575 static inline bool page_is_buddy(struct page *page, struct page *buddy, in page_is_buddy() argument
578 if (!page_is_guard(buddy) && !PageBuddy(buddy)) in page_is_buddy()
581 if (buddy_order(buddy) != order) in page_is_buddy()
588 if (page_zone_id(page) != page_zone_id(buddy)) in page_is_buddy()
591 VM_BUG_ON_PAGE(page_count(buddy) != 0, buddy); in page_is_buddy()
637 struct page *buddy; in find_buddy_page_pfn() local
639 buddy = page + (__buddy_pfn - pfn); in find_buddy_page_pfn()
643 if (page_is_buddy(page, buddy, order)) in find_buddy_page_pfn()
644 return buddy; in find_buddy_page_pfn()
H A Dpage_isolation.c211 struct page *buddy; in unset_migratetype_isolate() local
229 buddy = find_buddy_page_pfn(page, page_to_pfn(page), in unset_migratetype_isolate()
231 if (buddy && !is_migrate_isolate_page(buddy)) { in unset_migratetype_isolate()
H A Dpage_alloc.c779 struct page *buddy; in __free_one_page() local
799 buddy = find_buddy_page_pfn(page, pfn, order, &buddy_pfn); in __free_one_page()
800 if (!buddy) in __free_one_page()
810 buddy_mt = get_pfnblock_migratetype(buddy, buddy_pfn); in __free_one_page()
822 if (page_is_guard(buddy)) in __free_one_page()
823 clear_page_guard(zone, buddy, order); in __free_one_page()
825 __del_page_from_free_list(buddy, zone, order, buddy_mt); in __free_one_page()
833 set_pageblock_migratetype(buddy, migratetype); in __free_one_page()
1789 struct page *buddy = pfn_to_page(pfn); in move_freepages_block_isolate() local
1790 int order = buddy_order(buddy); in move_freepages_block_isolate()
[all …]
H A Ddebug.c57 DEF_PAGETYPE_NAME(buddy),
/linux/drivers/gpu/drm/
H A Ddrm_buddy.c128 struct drm_buddy_block *buddy; in __drm_buddy_free() local
130 buddy = __get_buddy(block); in __drm_buddy_free()
132 if (!drm_buddy_block_is_free(buddy)) in __drm_buddy_free()
141 drm_buddy_block_is_clear(buddy)) in __drm_buddy_free()
148 list_del(&buddy->link); in __drm_buddy_free()
149 if (force_merge && drm_buddy_block_is_clear(buddy)) in __drm_buddy_free()
150 mm->clear_avail -= drm_buddy_block_size(mm, buddy); in __drm_buddy_free()
153 drm_block_free(mm, buddy); in __drm_buddy_free()
182 struct drm_buddy_block *buddy; in __force_merge() local
194 buddy = __get_buddy(block); in __force_merge()
[all …]
/linux/fs/ext4/
H A Dmballoc-test.c604 static void mbt_generate_buddy(struct super_block *sb, void *buddy, in mbt_generate_buddy() argument
612 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()
640 bb_h = buddy + sbi->s_mb_offsets[order + 1]; in mbt_generate_buddy()
748 void *buddy, struct ext4_group_info *grp) in test_mb_mark_used_range() argument
769 memset(buddy, 0xff, sb->s_blocksize); in test_mb_mark_used_range()
772 ext4_mb_generate_buddy(sb, buddy, bitmap, 0, grp); in test_mb_mark_used_range()
774 KUNIT_ASSERT_EQ(test, memcmp(buddy, e4b->bd_buddy, sb->s_blocksize), in test_mb_mark_used_range()
783 void *bitmap, *buddy; in test_mb_mark_used() local
[all …]
H A Dmballoc.c695 void *buddy; in __mb_check_buddy() local
702 buddy = mb_find_buddy(e4b, order, &max); in __mb_check_buddy()
703 MB_CHECK_ASSERT(buddy); in __mb_check_buddy()
706 MB_CHECK_ASSERT(buddy != buddy2); in __mb_check_buddy()
712 if (mb_test_bit(i, buddy)) { in __mb_check_buddy()
737 buddy = mb_find_buddy(e4b, 0, &max); in __mb_check_buddy()
739 if (!mb_test_bit(i, buddy)) { in __mb_check_buddy()
769 MB_CHECK_ASSERT(mb_test_bit(k + i, buddy)); in __mb_check_buddy()
786 void *buddy, ext4_grpblk_t first, ext4_grpblk_t len, in ext4_mb_mark_free_simple() argument
814 buddy + sbi->s_mb_offsets[min]); in ext4_mb_mark_free_simple()
[all …]
/linux/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/drivers/dma-buf/heaps/
H A DKconfig6 is backed by pages from the buddy allocator. If in doubt, say Y.
/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/fs/jfs/
H A Djfs_dmap.c2775 int budsz, buddy; in dbJoin() local
2805 buddy = leafno ^ budsz; in dbJoin()
2810 if (newval > leaf[buddy]) in dbJoin()
2814 if (newval < leaf[buddy]) in dbJoin()
2825 if (leafno < buddy) { in dbJoin()
2828 dbAdjTree(tp, buddy, NOFREE, is_ctl); in dbJoin()
2834 leafno = buddy; in dbJoin()
/linux/include/linux/
H A Dpage-flags.h1002 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.rst98 A free memory block managed by the buddy system allocator.
99 The buddy system organizes free memory in blocks of various orders.
/linux/Documentation/admin-guide/sysctl/
H A Dvm.rst629 buddy allocator will be optimized (7 pages per 2MB HugeTLB page and 4095 pages
632 to the buddy allocator, the vmemmap pages representing that range needs to be
639 of allocation or freeing HugeTLB pages between the HugeTLB pool and the buddy
642 pool to the buddy allocator since the allocation of vmemmap pages could be
646 buddy allocator will not be optimized meaning the extra overhead at allocation
647 time from buddy allocator disappears, whereas already optimized HugeTLB pages
/linux/arch/x86/kvm/vmx/
H A Dvmx.h380 struct loaded_vmcs *buddy);
/linux/Documentation/mm/
H A Dtranshuge.rst23 immediately in the buddy or through the VM), guest physical memory
/linux/include/trace/events/
H A Dext4.h1046 __field( __u16, buddy )
1070 __entry->buddy = ac->ac_buddy;
1088 __entry->buddy ? 1 << __entry->buddy : 0)
/linux/Documentation/admin-guide/
H A Dext4.rst438 details of multiblock allocator buddy cache of free blocks
492 power of 2) where the buddy cache is used.

12