Home
last modified time | relevance | path

Searched refs:heap (Results 1 - 25 of 121) sorted by relevance

12345

/kernel/linux/linux-5.10/drivers/staging/android/ion/
H A Dion_heap.c3 * ION Memory Allocator generic heap helpers
20 void *ion_heap_map_kernel(struct ion_heap *heap, in ion_heap_map_kernel() argument
54 void ion_heap_unmap_kernel(struct ion_heap *heap, in ion_heap_unmap_kernel() argument
60 int ion_heap_map_user(struct ion_heap *heap, struct ion_buffer *buffer, in ion_heap_map_user() argument
130 void ion_heap_freelist_add(struct ion_heap *heap, struct ion_buffer *buffer) in ion_heap_freelist_add() argument
132 spin_lock(&heap->free_lock); in ion_heap_freelist_add()
133 list_add(&buffer->list, &heap->free_list); in ion_heap_freelist_add()
134 heap->free_list_size += buffer->size; in ion_heap_freelist_add()
135 spin_unlock(&heap->free_lock); in ion_heap_freelist_add()
136 wake_up(&heap in ion_heap_freelist_add()
139 ion_heap_freelist_size(struct ion_heap *heap) ion_heap_freelist_size() argument
150 _ion_heap_freelist_drain(struct ion_heap *heap, size_t size, bool skip_pools) _ion_heap_freelist_drain() argument
182 ion_heap_freelist_drain(struct ion_heap *heap, size_t size) ion_heap_freelist_drain() argument
187 ion_heap_freelist_shrink(struct ion_heap *heap, size_t size) ion_heap_freelist_shrink() argument
194 struct ion_heap *heap = data; ion_heap_deferred_free() local
218 ion_heap_init_deferred_free(struct ion_heap *heap) ion_heap_init_deferred_free() argument
237 struct ion_heap *heap = container_of(shrinker, struct ion_heap, ion_heap_shrink_count() local
252 struct ion_heap *heap = container_of(shrinker, struct ion_heap, ion_heap_shrink_scan() local
278 ion_heap_init_shrinker(struct ion_heap *heap) ion_heap_init_shrinker() argument
[all...]
H A Dion_system_heap.c3 * ION Memory Allocator system heap exporter
43 struct ion_heap heap; member
47 static struct page *alloc_buffer_page(struct ion_system_heap *heap, in alloc_buffer_page() argument
51 struct ion_page_pool *pool = heap->pools[order_to_index(order)]; in alloc_buffer_page()
56 static void free_buffer_page(struct ion_system_heap *heap, in free_buffer_page() argument
68 pool = heap->pools[order_to_index(order)]; in free_buffer_page()
73 static struct page *alloc_largest_available(struct ion_system_heap *heap, in alloc_largest_available() argument
87 page = alloc_buffer_page(heap, buffer, orders[i]); in alloc_largest_available()
97 static int ion_system_heap_allocate(struct ion_heap *heap, in ion_system_heap_allocate() argument
102 struct ion_system_heap *sys_heap = container_of(heap, in ion_system_heap_allocate()
171 ion_system_heap_shrink(struct ion_heap *heap, gfp_t gfp_mask, int nr_to_scan) ion_system_heap_shrink() argument
250 struct ion_system_heap *heap; __ion_system_heap_create() local
271 struct ion_heap *heap; ion_system_heap_create() local
284 ion_system_contig_heap_allocate(struct ion_heap *heap, struct ion_buffer *buffer, unsigned long len, unsigned long flags) ion_system_contig_heap_allocate() argument
353 struct ion_heap *heap; __ion_system_contig_heap_create() local
367 struct ion_heap *heap; ion_system_contig_heap_create() local
[all...]
H A Dion.c33 static struct ion_buffer *ion_buffer_create(struct ion_heap *heap, in ion_buffer_create() argument
45 buffer->heap = heap; in ion_buffer_create()
50 ret = heap->ops->allocate(heap, buffer, len, flags); in ion_buffer_create()
53 if (!(heap->flags & ION_HEAP_FLAG_DEFER_FREE)) in ion_buffer_create()
56 ion_heap_freelist_drain(heap, 0); in ion_buffer_create()
57 ret = heap->ops->allocate(heap, buffer, len, flags); in ion_buffer_create()
63 WARN_ONCE(1, "This heap need in ion_buffer_create()
104 struct ion_heap *heap = buffer->heap; _ion_buffer_destroy() local
346 struct ion_heap *heap; ion_alloc() local
404 struct ion_heap *heap; ion_query_heaps() local
527 struct ion_heap *heap = data; debug_shrink_set() local
545 struct ion_heap *heap = data; debug_shrink_get() local
560 ion_device_add_heap(struct ion_heap *heap) ion_device_add_heap() argument
[all...]
H A Dion.h28 * @heap: back pointer to the heap the buffer came from
43 struct ion_heap *heap; member
71 * struct ion_heap_ops - ops to operate on a given heap
86 int (*allocate)(struct ion_heap *heap,
90 void * (*map_kernel)(struct ion_heap *heap, struct ion_buffer *buffer);
91 void (*unmap_kernel)(struct ion_heap *heap, struct ion_buffer *buffer);
94 int (*shrink)(struct ion_heap *heap, gfp_t gfp_mask, int nr_to_scan);
98 * heap flags - flags between the heaps and core ion code
107 * heap
[all...]
H A Dion_cma_heap.c3 * ION Memory Allocator CMA heap exporter
20 struct ion_heap heap; member
24 #define to_cma_heap(x) container_of(x, struct ion_cma_heap, heap)
26 /* ION CMA heap operations functions */
27 static int ion_cma_allocate(struct ion_heap *heap, struct ion_buffer *buffer, in ion_cma_allocate() argument
31 struct ion_cma_heap *cma_heap = to_cma_heap(heap); in ion_cma_allocate()
85 struct ion_cma_heap *cma_heap = to_cma_heap(buffer->heap); in ion_cma_free()
113 cma_heap->heap.ops = &ion_cma_ops; in __ion_cma_heap_create()
115 cma_heap->heap.type = ION_HEAP_TYPE_DMA; in __ion_cma_heap_create()
116 return &cma_heap->heap; in __ion_cma_heap_create()
121 struct ion_heap *heap; __ion_add_cma_heaps() local
[all...]
/kernel/linux/linux-5.10/drivers/dma-buf/
H A Ddma-heap.c20 #include <linux/dma-heap.h>
21 #include <uapi/linux/dma-heap.h>
28 * struct dma_heap - represents a dmabuf heap in the system
30 * @ops: ops struct for this heap
31 * @heap_devt heap device node
33 * @heap_cdev heap char device
35 * Represents a heap of memory from which buffers can be made.
52 static int dma_heap_buffer_alloc(struct dma_heap *heap, size_t len, in dma_heap_buffer_alloc() argument
64 return heap->ops->allocate(heap, le in dma_heap_buffer_alloc()
69 struct dma_heap *heap; dma_heap_open() local
87 struct dma_heap *heap = file->private_data; dma_heap_ioctl_allocate() local
190 dma_heap_get_drvdata(struct dma_heap *heap) dma_heap_get_drvdata() argument
202 dma_heap_get_name(struct dma_heap *heap) dma_heap_get_name() argument
209 struct dma_heap *heap, *h, *err_ret; dma_heap_add() local
[all...]
/kernel/linux/linux-5.10/lib/
H A Dtest_min_heap.c5 * Test cases for the min max heap.
33 struct min_heap *heap, in pop_verify_heap()
36 int *values = heap->data; in pop_verify_heap()
41 min_heap_pop(heap, funcs); in pop_verify_heap()
42 while (heap->nr > 0) { in pop_verify_heap()
57 min_heap_pop(heap, funcs); in pop_verify_heap()
66 struct min_heap heap = { in test_heapify_all() local
79 min_heapify_all(&heap, &funcs); in test_heapify_all()
80 err = pop_verify_heap(min_heap, &heap, &funcs); in test_heapify_all()
84 heap in test_heapify_all()
32 pop_verify_heap(bool min_heap, struct min_heap *heap, const struct min_heap_callbacks *funcs) pop_verify_heap() argument
99 struct min_heap heap = { test_heap_push() local
132 struct min_heap heap = { test_heap_pop_push() local
[all...]
/kernel/linux/linux-6.6/lib/
H A Dtest_min_heap.c5 * Test cases for the min max heap.
33 struct min_heap *heap, in pop_verify_heap()
36 int *values = heap->data; in pop_verify_heap()
41 min_heap_pop(heap, funcs); in pop_verify_heap()
42 while (heap->nr > 0) { in pop_verify_heap()
57 min_heap_pop(heap, funcs); in pop_verify_heap()
66 struct min_heap heap = { in test_heapify_all() local
79 min_heapify_all(&heap, &funcs); in test_heapify_all()
80 err = pop_verify_heap(min_heap, &heap, &funcs); in test_heapify_all()
84 heap in test_heapify_all()
32 pop_verify_heap(bool min_heap, struct min_heap *heap, const struct min_heap_callbacks *funcs) pop_verify_heap() argument
99 struct min_heap heap = { test_heap_push() local
132 struct min_heap heap = { test_heap_pop_push() local
[all...]
/kernel/linux/linux-5.10/include/linux/
H A Dmin_heap.h10 * struct min_heap - Data structure to hold a min-heap.
11 * @data: Start of array holding the heap elements.
12 * @nr: Number of elements currently in the heap.
24 * @less: Partial order function for this heap.
33 /* Sift the element at pos down the heap. */
35 void min_heapify(struct min_heap *heap, int pos, in min_heapify() argument
39 void *data = heap->data; in min_heapify()
42 if (pos * 2 + 1 >= heap->nr) in min_heapify()
51 if (pos * 2 + 2 < heap->nr) { in min_heapify()
68 void min_heapify_all(struct min_heap *heap, in min_heapify_all() argument
79 min_heap_pop(struct min_heap *heap, const struct min_heap_callbacks *func) min_heap_pop() argument
99 min_heap_pop_push(struct min_heap *heap, const void *element, const struct min_heap_callbacks *func) min_heap_pop_push() argument
109 min_heap_push(struct min_heap *heap, const void *element, const struct min_heap_callbacks *func) min_heap_push() argument
[all...]
/kernel/linux/linux-6.6/include/linux/
H A Dmin_heap.h10 * struct min_heap - Data structure to hold a min-heap.
11 * @data: Start of array holding the heap elements.
12 * @nr: Number of elements currently in the heap.
24 * @less: Partial order function for this heap.
33 /* Sift the element at pos down the heap. */
35 void min_heapify(struct min_heap *heap, int pos, in min_heapify() argument
39 void *data = heap->data; in min_heapify()
42 if (pos * 2 + 1 >= heap->nr) in min_heapify()
51 if (pos * 2 + 2 < heap->nr) { in min_heapify()
68 void min_heapify_all(struct min_heap *heap, in min_heapify_all() argument
79 min_heap_pop(struct min_heap *heap, const struct min_heap_callbacks *func) min_heap_pop() argument
99 min_heap_pop_push(struct min_heap *heap, const void *element, const struct min_heap_callbacks *func) min_heap_pop_push() argument
109 min_heap_push(struct min_heap *heap, const void *element, const struct min_heap_callbacks *func) min_heap_push() argument
[all...]
/kernel/linux/linux-6.6/drivers/dma-buf/
H A Ddma-heap.c20 #include <linux/dma-heap.h>
21 #include <uapi/linux/dma-heap.h>
28 * struct dma_heap - represents a dmabuf heap in the system
30 * @ops: ops struct for this heap
31 * @heap_devt heap device node
33 * @heap_cdev heap char device
35 * Represents a heap of memory from which buffers can be made.
52 static int dma_heap_buffer_alloc(struct dma_heap *heap, size_t len, in dma_heap_buffer_alloc() argument
67 dmabuf = heap->ops->allocate(heap, le in dma_heap_buffer_alloc()
81 struct dma_heap *heap; dma_heap_open() local
99 struct dma_heap *heap = file->private_data; dma_heap_ioctl_allocate() local
202 dma_heap_get_drvdata(struct dma_heap *heap) dma_heap_get_drvdata() argument
214 dma_heap_get_name(struct dma_heap *heap) dma_heap_get_name() argument
221 struct dma_heap *heap, *h, *err_ret; dma_heap_add() local
[all...]
/kernel/linux/linux-5.10/fs/ubifs/
H A Dlprops.c22 * get_heap_comp_val - get the LEB properties value for heap comparisons.
39 * move_up_lpt_heap - move a new heap entry up as far as possible.
41 * @heap: LEB category heap
45 * New entries to a heap are added at the bottom and then moved up until the
50 static void move_up_lpt_heap(struct ubifs_info *c, struct ubifs_lpt_heap *heap, in move_up_lpt_heap() argument
57 return; /* Already top of the heap */ in move_up_lpt_heap()
59 /* Compare to parent and, if greater, move up the heap */ in move_up_lpt_heap()
63 val2 = get_heap_comp_val(heap->arr[ppos], cat); in move_up_lpt_heap()
67 heap in move_up_lpt_heap()
87 adjust_lpt_heap(struct ubifs_info *c, struct ubifs_lpt_heap *heap, struct ubifs_lprops *lprops, int hpos, int cat) adjust_lpt_heap() argument
169 struct ubifs_lpt_heap *heap = &c->lpt_heap[cat - 1]; add_to_lpt_heap() local
217 struct ubifs_lpt_heap *heap; remove_from_lpt_heap() local
246 struct ubifs_lpt_heap *heap; lpt_heap_replace() local
442 struct ubifs_lpt_heap *heap; change_category() local
757 struct ubifs_lpt_heap *heap; ubifs_fast_find_free() local
928 struct ubifs_lpt_heap *heap = &c->lpt_heap[cat - 1]; dbg_check_cats() local
950 dbg_check_heap(struct ubifs_info *c, struct ubifs_lpt_heap *heap, int cat, int add_pos) dbg_check_heap() argument
1071 struct ubifs_lpt_heap *heap = &c->lpt_heap[cat - 1]; scan_check_cb() local
[all...]
/kernel/linux/linux-6.6/fs/ubifs/
H A Dlprops.c22 * get_heap_comp_val - get the LEB properties value for heap comparisons.
39 * move_up_lpt_heap - move a new heap entry up as far as possible.
41 * @heap: LEB category heap
45 * New entries to a heap are added at the bottom and then moved up until the
50 static void move_up_lpt_heap(struct ubifs_info *c, struct ubifs_lpt_heap *heap, in move_up_lpt_heap() argument
57 return; /* Already top of the heap */ in move_up_lpt_heap()
59 /* Compare to parent and, if greater, move up the heap */ in move_up_lpt_heap()
63 val2 = get_heap_comp_val(heap->arr[ppos], cat); in move_up_lpt_heap()
67 heap in move_up_lpt_heap()
87 adjust_lpt_heap(struct ubifs_info *c, struct ubifs_lpt_heap *heap, struct ubifs_lprops *lprops, int hpos, int cat) adjust_lpt_heap() argument
169 struct ubifs_lpt_heap *heap = &c->lpt_heap[cat - 1]; add_to_lpt_heap() local
217 struct ubifs_lpt_heap *heap; remove_from_lpt_heap() local
246 struct ubifs_lpt_heap *heap; lpt_heap_replace() local
442 struct ubifs_lpt_heap *heap; change_category() local
757 struct ubifs_lpt_heap *heap; ubifs_fast_find_free() local
928 struct ubifs_lpt_heap *heap = &c->lpt_heap[cat - 1]; dbg_check_cats() local
950 dbg_check_heap(struct ubifs_info *c, struct ubifs_lpt_heap *heap, int cat, int add_pos) dbg_check_heap() argument
1071 struct ubifs_lpt_heap *heap = &c->lpt_heap[cat - 1]; scan_check_cb() local
[all...]
/kernel/linux/linux-6.6/tools/include/nolibc/
H A Dstdlib.h72 struct nolibc_heap *heap; in free() local
77 heap = container_of(ptr, struct nolibc_heap, user_p); in free()
78 munmap(heap, heap->len); in free()
133 struct nolibc_heap *heap; in malloc() local
136 len = sizeof(*heap) + len; in malloc()
138 heap = mmap(NULL, len, PROT_READ|PROT_WRITE, MAP_ANONYMOUS|MAP_PRIVATE, in malloc()
140 if (__builtin_expect(heap == MAP_FAILED, 0)) in malloc()
143 heap->len = len; in malloc()
144 return heap in malloc()
167 struct nolibc_heap *heap; realloc() local
[all...]
/kernel/linux/linux-5.10/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/
H A Dbase.c255 nvkm_mmu_type(struct nvkm_mmu *mmu, int heap, u8 type) in nvkm_mmu_type() argument
257 if (heap >= 0 && !WARN_ON(mmu->type_nr == ARRAY_SIZE(mmu->type))) { in nvkm_mmu_type()
258 mmu->type[mmu->type_nr].type = type | mmu->heap[heap].type; in nvkm_mmu_type()
259 mmu->type[mmu->type_nr].heap = heap; in nvkm_mmu_type()
268 if (!WARN_ON(mmu->heap_nr == ARRAY_SIZE(mmu->heap))) { in nvkm_mmu_heap()
269 mmu->heap[mmu->heap_nr].type = type; in nvkm_mmu_heap()
270 mmu->heap[mmu->heap_nr].size = size; in nvkm_mmu_heap()
282 int heap; in nvkm_mmu_host() local
323 u8 heap = NVKM_MEM_VRAM; nvkm_mmu_vram() local
[all...]
/kernel/linux/linux-6.6/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/
H A Dbase.c255 nvkm_mmu_type(struct nvkm_mmu *mmu, int heap, u8 type) in nvkm_mmu_type() argument
257 if (heap >= 0 && !WARN_ON(mmu->type_nr == ARRAY_SIZE(mmu->type))) { in nvkm_mmu_type()
258 mmu->type[mmu->type_nr].type = type | mmu->heap[heap].type; in nvkm_mmu_type()
259 mmu->type[mmu->type_nr].heap = heap; in nvkm_mmu_type()
268 if (!WARN_ON(mmu->heap_nr == ARRAY_SIZE(mmu->heap))) { in nvkm_mmu_heap()
269 mmu->heap[mmu->heap_nr].type = type; in nvkm_mmu_heap()
270 mmu->heap[mmu->heap_nr].size = size; in nvkm_mmu_heap()
282 int heap; in nvkm_mmu_host() local
323 u8 heap = NVKM_MEM_VRAM; nvkm_mmu_vram() local
[all...]
/kernel/linux/linux-5.10/drivers/dma-buf/heaps/
H A Dcma_heap.c3 * DMABUF CMA heap exporter
12 #include <linux/dma-heap.h>
22 #include "heap-helpers.h"
25 struct dma_heap *heap; member
31 struct cma_heap *cma_heap = dma_heap_get_drvdata(buffer->heap); in cma_heap_free()
42 /* dmabuf heap CMA operations functions */
43 static int cma_heap_allocate(struct dma_heap *heap, in cma_heap_allocate() argument
48 struct cma_heap *cma_heap = dma_heap_get_drvdata(heap); in cma_heap_allocate()
66 helper_buffer->heap = heap; in cma_heap_allocate()
[all...]
/kernel/linux/linux-5.10/drivers/gpu/drm/nouveau/include/nvkm/core/
H A Dmm.h12 u8 heap; member
34 int nvkm_mm_init(struct nvkm_mm *, u8 heap, u32 offset, u32 length, u32 block);
36 int nvkm_mm_head(struct nvkm_mm *, u8 heap, u8 type, u32 size_max,
38 int nvkm_mm_tail(struct nvkm_mm *, u8 heap, u8 type, u32 size_max,
44 nvkm_mm_heap_size(struct nvkm_mm *mm, u8 heap) in nvkm_mm_heap_size() argument
49 if (node->heap == heap) in nvkm_mm_heap_size()
/kernel/linux/linux-6.6/drivers/gpu/drm/nouveau/include/nvkm/core/
H A Dmm.h12 u8 heap; member
34 int nvkm_mm_init(struct nvkm_mm *, u8 heap, u32 offset, u32 length, u32 block);
36 int nvkm_mm_head(struct nvkm_mm *, u8 heap, u8 type, u32 size_max,
38 int nvkm_mm_tail(struct nvkm_mm *, u8 heap, u8 type, u32 size_max,
44 nvkm_mm_heap_size(struct nvkm_mm *mm, u8 heap) in nvkm_mm_heap_size() argument
49 if (node->heap == heap) in nvkm_mm_heap_size()
/kernel/linux/linux-5.10/drivers/gpu/drm/nouveau/nvkm/core/
H A Dmm.c99 b->heap = a->heap; in region_head()
111 nvkm_mm_head(struct nvkm_mm *mm, u8 heap, u8 type, u32 size_max, u32 size_min, in nvkm_mm_head() argument
122 if (unlikely(heap != NVKM_MM_HEAP_ANY)) { in nvkm_mm_head()
123 if (this->heap != heap) in nvkm_mm_head()
175 b->heap = a->heap; in region_tail()
186 nvkm_mm_tail(struct nvkm_mm *mm, u8 heap, u8 type, u32 size_max, u32 size_min, in nvkm_mm_tail() argument
198 if (unlikely(heap ! in nvkm_mm_tail()
240 nvkm_mm_init(struct nvkm_mm *mm, u8 heap, u32 offset, u32 length, u32 block) nvkm_mm_init() argument
[all...]
/kernel/linux/linux-6.6/drivers/gpu/drm/nouveau/nvkm/core/
H A Dmm.c99 b->heap = a->heap; in region_head()
111 nvkm_mm_head(struct nvkm_mm *mm, u8 heap, u8 type, u32 size_max, u32 size_min, in nvkm_mm_head() argument
122 if (unlikely(heap != NVKM_MM_HEAP_ANY)) { in nvkm_mm_head()
123 if (this->heap != heap) in nvkm_mm_head()
175 b->heap = a->heap; in region_tail()
186 nvkm_mm_tail(struct nvkm_mm *mm, u8 heap, u8 type, u32 size_max, u32 size_min, in nvkm_mm_tail() argument
198 if (unlikely(heap ! in nvkm_mm_tail()
240 nvkm_mm_init(struct nvkm_mm *mm, u8 heap, u32 offset, u32 length, u32 block) nvkm_mm_init() argument
[all...]
/kernel/linux/linux-5.10/drivers/gpu/drm/nouveau/nvif/
H A Dmmu.c32 kfree(mmu->heap); in nvif_mmu_dtor()
50 mmu->heap = NULL; in nvif_mmu_ctor()
69 mmu->heap = kmalloc_array(mmu->heap_nr, sizeof(*mmu->heap), in nvif_mmu_ctor()
73 if (ret = -ENOMEM, !mmu->heap || !mmu->type) in nvif_mmu_ctor()
89 mmu->heap[i].size = args.size; in nvif_mmu_ctor()
109 mmu->type[i].heap = args.heap; in nvif_mmu_ctor()
/kernel/linux/linux-6.6/drivers/gpu/drm/nouveau/nvif/
H A Dmmu.c35 kfree(mmu->heap); in nvif_mmu_dtor()
53 mmu->heap = NULL; in nvif_mmu_ctor()
72 mmu->heap = kmalloc_array(mmu->heap_nr, sizeof(*mmu->heap), in nvif_mmu_ctor()
76 if (ret = -ENOMEM, !mmu->heap || !mmu->type) in nvif_mmu_ctor()
92 mmu->heap[i].size = args.size; in nvif_mmu_ctor()
112 mmu->type[i].heap = args.heap; in nvif_mmu_ctor()
/kernel/linux/linux-5.10/lib/zlib_deflate/
H A Ddeftree.c85 * need for the L_CODES extra codes used during heap construction. However
289 /* Index within the heap array of least frequent node in the Huffman tree */
293 * Remove the smallest element from the heap and recreate the heap with
294 * one less element. Updates heap and heap_len.
298 top = s->heap[SMALLEST]; \
299 s->heap[SMALLEST] = s->heap[s->heap_len--]; \
312 * Restore the heap property by moving down the tree starting at node k,
314 * when the heap propert
[all...]
/kernel/linux/linux-6.6/lib/zlib_deflate/
H A Ddeftree.c85 * need for the L_CODES extra codes used during heap construction. However
289 /* Index within the heap array of least frequent node in the Huffman tree */
293 * Remove the smallest element from the heap and recreate the heap with
294 * one less element. Updates heap and heap_len.
298 top = s->heap[SMALLEST]; \
299 s->heap[SMALLEST] = s->heap[s->heap_len--]; \
312 * Restore the heap property by moving down the tree starting at node k,
314 * when the heap propert
[all...]

Completed in 11 milliseconds

12345