static void mlx4_free_buf_huge_ex(struct mlx4_context *mctx, struct mlx4_buf *buf, int do_fork) { struct mlx4_hugetlb_mem *hmem; if (do_fork) ibv_dofork_range(buf->buf, buf->length); if (buf->hmem == NULL) { if (mlx4_trace) perror("No hugetlb mem"); return; } hmem = (struct mlx4_hugetlb_mem *) buf->hmem; mlx4_spin_lock(&mctx->hugetlb_lock); mlx4_bitmap_free_range(&hmem->bitmap, buf->base, buf->length/MLX4_Q_CHUNK_SIZE); if (is_bitmap_empty(&hmem->bitmap)) { list_del(&hmem->list); mlx4_hugetlb_mem_free(hmem); } mlx4_spin_unlock(&mctx->hugetlb_lock); }
void mlx4_bitmap_free(struct mlx4_bitmap *bitmap, u32 obj, int use_rr) { mlx4_bitmap_free_range(bitmap, obj, 1, use_rr); }
void mlx4_bitmap_free(struct mlx4_bitmap *bitmap, u32 obj) { mlx4_bitmap_free_range(bitmap, obj, 1); }