| /linux/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/ |
| H A D | buddy.c | 7 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 D | pool.c | 114 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 D | dr_buddy.c | 10 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 D | dr_icm_pool.c | 199 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 D | mlx5dr.h | 185 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 D | mthca_mr.c | 42 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 D | mballoc-test.c | 604 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 D | mballoc.c | 718 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 …]
|
| /linux/drivers/gpu/drm/ |
| H A D | drm_buddy.c | 189 struct drm_buddy_block *buddy; in __drm_buddy_free() local 191 buddy = __get_buddy(block); in __drm_buddy_free() 193 if (!drm_buddy_block_is_free(buddy)) in __drm_buddy_free() 202 drm_buddy_block_is_clear(buddy)) in __drm_buddy_free() 209 rbtree_remove(mm, buddy); in __drm_buddy_free() 210 if (force_merge && drm_buddy_block_is_clear(buddy)) in __drm_buddy_free() 211 mm->clear_avail -= drm_buddy_block_size(mm, buddy); in __drm_buddy_free() 214 drm_block_free(mm, buddy); in __drm_buddy_free() 244 struct drm_buddy_block *block, *buddy; in __force_merge() local 259 buddy = __get_buddy(block); in __force_merge() [all …]
|
| H A D | Kconfig | 224 A page based buddy allocator
|
| /linux/mm/ |
| H A D | internal.h | 717 static inline bool page_is_buddy(struct page *page, struct page *buddy, in page_is_buddy() argument 720 if (!page_is_guard(buddy) && !PageBuddy(buddy)) in page_is_buddy() 723 if (buddy_order(buddy) != order) in page_is_buddy() 730 if (page_zone_id(page) != page_zone_id(buddy)) in page_is_buddy() 733 VM_BUG_ON_PAGE(page_count(buddy) != 0, buddy); in page_is_buddy() 779 struct page *buddy; in find_buddy_page_pfn() local 781 buddy = page + (__buddy_pfn - pfn); in find_buddy_page_pfn() 785 if (page_is_buddy(page, buddy, order)) in find_buddy_page_pfn() 786 return buddy; in find_buddy_page_pfn()
|
| H A D | page_alloc.c | 986 struct page *buddy; in __free_one_page() local 1006 buddy = find_buddy_page_pfn(page, pfn, order, &buddy_pfn); in __free_one_page() 1007 if (!buddy) in __free_one_page() 1017 buddy_mt = get_pfnblock_migratetype(buddy, buddy_pfn); in __free_one_page() 1029 if (page_is_guard(buddy)) in __free_one_page() 1030 clear_page_guard(zone, buddy, order); in __free_one_page() 1032 __del_page_from_free_list(buddy, zone, order, buddy_mt); in __free_one_page() 1040 change_pageblock_range(buddy, order, migratetype); in __free_one_page() 2135 struct page *buddy; in __move_freepages_block_isolate() local 2151 buddy = pfn_to_page(buddy_pfn); in __move_freepages_block_isolate() [all …]
|
| H A D | debug.c | 57 DEF_PAGETYPE_NAME(buddy),
|
| /linux/Documentation/gpu/rfc/ |
| H A D | i915_gem_lmem.rst | 20 * Move i915 buddy allocator over to TTM
|
| /linux/Documentation/trace/ |
| H A D | events-kmem.rst | 56 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 D | jfs_dmap.c | 2772 int budsz, buddy; in dbJoin() local 2802 buddy = leafno ^ budsz; in dbJoin() 2807 if (newval > leaf[buddy]) in dbJoin() 2811 if (newval < leaf[buddy]) in dbJoin() 2822 if (leafno < buddy) { in dbJoin() 2825 dbAdjTree(tp, buddy, NOFREE, is_ctl); in dbJoin() 2831 leafno = buddy; in dbJoin()
|
| /linux/Documentation/ABI/testing/ |
| H A D | sysfs-fs-ext4 | 37 requests (as a power of 2) where the buddy cache is
|
| /linux/include/linux/ |
| H A D | page-flags.h | 1003 PAGE_TYPE_OPS(Buddy, buddy, buddy)
|
| /linux/Documentation/admin-guide/mm/ |
| H A D | pagemap.rst | 115 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 D | vm.rst | 671 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 D | xe_svm.c | 766 struct drm_buddy *buddy = vram_to_buddy(vr); in xe_svm_populate_devmem_pfn() local 771 for (i = 0; i < drm_buddy_block_size(buddy, block) >> PAGE_SHIFT; ++i) in xe_svm_populate_devmem_pfn()
|
| /linux/Documentation/admin-guide/kdump/ |
| H A D | vmcoreinfo.rst | 196 free_area ranges. NR_PAGE_ORDERS is used by the zone buddy allocator.
|
| /linux/Documentation/RCU/ |
| H A D | rcu_dereference.rst | 63 classic buddy-allocator algorithms.
|
| /linux/lib/ |
| H A D | Kconfig.debug | 1204 bool "Prefer the buddy CPU hardlockup detector" 1209 Say Y here to prefer the buddy hardlockup detector over the perf one. 1211 With the buddy detector, each CPU uses its softlockup hrtimer 1243 # Both the "perf" and "buddy" hardlockup detectors count hrtimer
|
| /linux/Documentation/mm/ |
| H A D | hugetlbfs_reserv.rst | 229 an attempt will be made to allocate one using the buddy allocator. This
|