Home
last modified time | relevance | path

Searched full:cma (Results 1 – 25 of 307) sorted by relevance

12345678910>>...13

/kernel/linux/linux-5.10/mm/
Dcma_debug.c3 * CMA DebugFS Interface
10 #include <linux/cma.h>
16 #include "cma.h"
36 struct cma *cma = data; in cma_used_get() local
39 mutex_lock(&cma->lock); in cma_used_get()
41 used = bitmap_weight(cma->bitmap, (int)cma_bitmap_maxno(cma)); in cma_used_get()
42 mutex_unlock(&cma->lock); in cma_used_get()
43 *val = (u64)used << cma->order_per_bit; in cma_used_get()
51 struct cma *cma = data; in cma_maxchunk_get() local
54 unsigned long bitmap_maxno = cma_bitmap_maxno(cma); in cma_maxchunk_get()
[all …]
Dcma.c15 #define pr_fmt(fmt) "cma: " fmt
31 #include <linux/cma.h>
35 #include <trace/events/cma.h>
37 #include "cma.h"
39 struct cma cma_areas[MAX_CMA_AREAS];
43 phys_addr_t cma_get_base(const struct cma *cma) in cma_get_base() argument
45 return PFN_PHYS(cma->base_pfn); in cma_get_base()
48 unsigned long cma_get_size(const struct cma *cma) in cma_get_size() argument
50 return cma->count << PAGE_SHIFT; in cma_get_size()
53 const char *cma_get_name(const struct cma *cma) in cma_get_name() argument
[all …]
Dcma.h7 struct cma { struct
21 extern struct cma cma_areas[MAX_CMA_AREAS]; argument
24 static inline unsigned long cma_bitmap_maxno(struct cma *cma) in cma_bitmap_maxno() argument
26 return cma->count >> cma->order_per_bit; in cma_bitmap_maxno()
DKconfig312 depends on (NUMA || ARCH_ENABLE_MEMORY_HOTREMOVE || COMPACTION || CMA) && MMU
328 def_bool (MEMORY_ISOLATION && COMPACTION) || CMA
536 config CMA config
544 CMA reserves a region of memory and allows only movable pages to
552 bool "CMA debug messages (DEVELOPMENT)"
553 depends on DEBUG_KERNEL && CMA
555 Turns on debug messages in CMA. This produces KERN_DEBUG
556 messages for every CMA call as well as various messages while
561 bool "CMA debugfs interface"
562 depends on CMA && DEBUG_FS
[all …]
/kernel/linux/linux-6.6/mm/
Dcma_debug.c3 * CMA DebugFS Interface
10 #include <linux/cma.h>
16 #include "cma.h"
36 struct cma *cma = data; in cma_used_get() local
39 spin_lock_irq(&cma->lock); in cma_used_get()
41 used = bitmap_weight(cma->bitmap, (int)cma_bitmap_maxno(cma)); in cma_used_get()
42 spin_unlock_irq(&cma->lock); in cma_used_get()
43 *val = (u64)used << cma->order_per_bit; in cma_used_get()
51 struct cma *cma = data; in cma_maxchunk_get() local
54 unsigned long bitmap_maxno = cma_bitmap_maxno(cma); in cma_maxchunk_get()
[all …]
Dcma.c15 #define pr_fmt(fmt) "cma: " fmt
30 #include <linux/cma.h>
34 #include <trace/events/cma.h>
37 #include "cma.h"
39 struct cma cma_areas[MAX_CMA_AREAS];
43 phys_addr_t cma_get_base(const struct cma *cma) in cma_get_base() argument
45 return PFN_PHYS(cma->base_pfn); in cma_get_base()
48 unsigned long cma_get_size(const struct cma *cma) in cma_get_size() argument
50 return cma->count << PAGE_SHIFT; in cma_get_size()
53 const char *cma_get_name(const struct cma *cma) in cma_get_name() argument
[all …]
Dcma_sysfs.c3 * CMA SysFS Interface
8 #include <linux/cma.h>
12 #include "cma.h"
17 void cma_sysfs_account_success_pages(struct cma *cma, unsigned long nr_pages) in cma_sysfs_account_success_pages() argument
19 atomic64_add(nr_pages, &cma->nr_pages_succeeded); in cma_sysfs_account_success_pages()
22 void cma_sysfs_account_fail_pages(struct cma *cma, unsigned long nr_pages) in cma_sysfs_account_fail_pages() argument
24 atomic64_add(nr_pages, &cma->nr_pages_failed); in cma_sysfs_account_fail_pages()
27 static inline struct cma *cma_from_kobj(struct kobject *kobj) in cma_from_kobj()
29 return container_of(kobj, struct cma_kobject, kobj)->cma; in cma_from_kobj()
35 struct cma *cma = cma_from_kobj(kobj); in alloc_pages_success_show() local
[all …]
Dcma.h10 struct cma *cma; member
13 struct cma { struct
26 /* the number of CMA page successful allocations */
28 /* the number of CMA page allocation failures */
36 extern struct cma cma_areas[MAX_CMA_AREAS]; argument
39 static inline unsigned long cma_bitmap_maxno(struct cma *cma) in cma_bitmap_maxno() argument
41 return cma->count >> cma->order_per_bit; in cma_bitmap_maxno()
45 void cma_sysfs_account_success_pages(struct cma *cma, unsigned long nr_pages);
46 void cma_sysfs_account_fail_pages(struct cma *cma, unsigned long nr_pages);
48 static inline void cma_sysfs_account_success_pages(struct cma *cma, in cma_sysfs_account_success_pages() argument
[all …]
/kernel/linux/linux-6.6/include/linux/
Dcma.h10 * There is always at least global CMA area and a few optional
27 struct cma;
30 extern phys_addr_t cma_get_base(const struct cma *cma);
31 extern unsigned long cma_get_size(const struct cma *cma);
32 extern const char *cma_get_name(const struct cma *cma);
37 bool fixed, const char *name, struct cma **res_cma,
42 bool fixed, const char *name, struct cma **res_cma) in cma_declare_contiguous()
50 struct cma **res_cma);
51 extern struct page *cma_alloc(struct cma *cma, unsigned long count, unsigned int align,
53 extern bool cma_pages_valid(struct cma *cma, const struct page *pages, unsigned long count);
[all …]
/kernel/linux/linux-5.10/include/linux/
Dcma.h10 * There is always at least global CMA area and a few optional
23 struct cma;
26 extern phys_addr_t cma_get_base(const struct cma *cma);
27 extern unsigned long cma_get_size(const struct cma *cma);
28 extern const char *cma_get_name(const struct cma *cma);
33 bool fixed, const char *name, struct cma **res_cma,
38 bool fixed, const char *name, struct cma **res_cma) in cma_declare_contiguous()
46 struct cma **res_cma);
47 extern struct page *cma_alloc(struct cma *cma, size_t count, unsigned int align,
49 extern bool cma_release(struct cma *cma, const struct page *pages, unsigned int count);
[all …]
/kernel/linux/linux-5.10/Documentation/admin-guide/mm/
Dcma_debugfs.rst2 CMA Debugfs Interface
5 The CMA debugfs interface is useful to retrieve basic information out of the
6 different CMA areas and to test allocation/release in each of the areas.
8 Each CMA zone represents a directory under <debugfs>/cma/, indexed by the
9 kernel's CMA index. So the first CMA zone would be:
11 <debugfs>/cma/cma-0
16 - [RO] count: Amount of memory in the CMA area.
19 - [WO] alloc: Allocate N pages from that CMA area. For example::
21 echo 5 > <debugfs>/cma/cma-2/alloc
23 would try to allocate 5 pages from the cma-2 area.
[all …]
/kernel/linux/linux-6.6/kernel/dma/
Dcontiguous.c11 * The Contiguous Memory Allocator (CMA) makes it possible to
32 * CMA tries to solve this issue by operating on memory regions
38 #define pr_fmt(fmt) "cma: " fmt
52 #include <linux/cma.h>
61 struct cma *dma_contiguous_default_area;
64 * Default global CMA area size can be defined in kernel's .config.
70 * Users, who want to set the size of global CMA area for their system
71 * should use cma= kernel parameter.
97 early_param("cma", early_cma);
101 static struct cma *dma_contiguous_numa_area[MAX_NUMNODES];
[all …]
DKconfig147 depends on HAVE_DMA_CONTIGUOUS && CMA
153 You can disable CMA by specifying "cma=0" on the kernel's command
165 Enable this option to get numa CMA areas so that NUMA devices
168 You can set the size of pernuma CMA by specifying "cma_pernuma=size"
169 or set the node id and its size of CMA by specifying "numa_cma=
181 Memory Allocator. If the size of 0 is selected, CMA is disabled by
182 default, but it can be enabled by passing cma=size[MG] to the kernel.
193 If 0 percent is selected, CMA is disabled by default, but it can be
194 enabled by passing cma=size[MG] to the kernel.
/kernel/linux/linux-6.6/Documentation/ABI/testing/
Dsysfs-kernel-mm-cma1 What: /sys/kernel/mm/cma/
5 /sys/kernel/mm/cma/ contains a subdirectory for each CMA
6 heap name (also sometimes called CMA areas).
8 Each CMA heap subdirectory (that is, each
9 /sys/kernel/mm/cma/<cma-heap-name> directory) contains the
15 What: /sys/kernel/mm/cma/<cma-heap-name>/alloc_pages_success
19 the number of pages CMA API succeeded to allocate
21 What: /sys/kernel/mm/cma/<cma-heap-name>/alloc_pages_fail
25 the number of pages CMA API failed to allocate
/kernel/linux/linux-5.10/kernel/dma/
Dcontiguous.c11 * The Contiguous Memory Allocator (CMA) makes it possible to
32 * CMA tries to solve this issue by operating on memory regions
38 #define pr_fmt(fmt) "cma: " fmt
52 #include <linux/cma.h>
60 struct cma *dma_contiguous_default_area;
63 * Default global CMA area size can be defined in kernel's .config.
69 * Users, who want to set the size of global CMA area for their system
70 * should use cma= kernel parameter.
97 early_param("cma", early_cma);
101 static struct cma *dma_contiguous_pernuma_area[MAX_NUMNODES];
[all …]
DKconfig112 depends on HAVE_DMA_CONTIGUOUS && CMA
118 You can disable CMA by specifying "cma=0" on the kernel's command
130 Enable this option to get pernuma CMA areas so that devices like
133 You can set the size of pernuma CMA by specifying "cma_pernuma=size"
145 Memory Allocator. If the size of 0 is selected, CMA is disabled by
146 default, but it can be enabled by passing cma=size[MG] to the kernel.
157 If 0 percent is selected, CMA is disabled by default, but it can be
158 enabled by passing cma=size[MG] to the kernel.
Dpool.c6 #include <linux/cma.h>
63 struct cma *cma; in cma_in_zone() local
65 cma = dev_get_cma_area(NULL); in cma_in_zone()
66 if (!cma) in cma_in_zone()
69 size = cma_get_size(cma); in cma_in_zone()
73 /* CMA can't cross zone boundaries, see cma_activate_area() */ in cma_in_zone()
74 end = cma_get_base(cma) + size - 1; in cma_in_zone()
/kernel/linux/linux-5.10/drivers/staging/android/ion/
Dion_cma_heap.c3 * ION Memory Allocator CMA heap exporter
13 #include <linux/cma.h>
21 struct cma *cma; member
26 /* ION CMA heap operations functions */
42 pages = cma_alloc(cma_heap->cma, nr_pages, align, false); in ion_cma_allocate()
79 cma_release(cma_heap->cma, pages, nr_pages); in ion_cma_allocate()
90 cma_release(cma_heap->cma, pages, nr_pages); in ion_cma_free()
104 static struct ion_heap *__ion_cma_heap_create(struct cma *cma) in __ion_cma_heap_create() argument
114 cma_heap->cma = cma; in __ion_cma_heap_create()
119 static int __ion_add_cma_heaps(struct cma *cma, void *data) in __ion_add_cma_heaps() argument
[all …]
/kernel/linux/linux-6.6/Documentation/admin-guide/mm/
Dcma_debugfs.rst2 CMA Debugfs Interface
5 The CMA debugfs interface is useful to retrieve basic information out of the
6 different CMA areas and to test allocation/release in each of the areas.
8 Each CMA area represents a directory under <debugfs>/cma/, represented by
9 its CMA name like below:
11 <debugfs>/cma/<cma_name>
16 - [RO] count: Amount of memory in the CMA area.
19 - [WO] alloc: Allocate N pages from that CMA area. For example::
21 echo 5 > <debugfs>/cma/<cma_name>/alloc
25 - [WO] free: Free N pages from that CMA area, similar to the above.
/kernel/linux/linux-5.10/drivers/dma-buf/heaps/
Dcma_heap.c3 * DMABUF CMA heap exporter
9 #include <linux/cma.h>
26 struct cma *cma; member
38 cma_release(cma_heap->cma, cma_pages, nr_pages); in cma_heap_free()
42 /* dmabuf heap CMA operations functions */
69 cma_pages = cma_alloc(cma_heap->cma, nr_pages, align, false); in cma_heap_allocate()
130 cma_release(cma_heap->cma, cma_pages, nr_pages); in cma_heap_allocate()
140 static int __add_cma_heap(struct cma *cma, void *data) in __add_cma_heap() argument
148 cma_heap->cma = cma; in __add_cma_heap()
150 exp_info.name = cma_get_name(cma); in __add_cma_heap()
[all …]
/kernel/linux/linux-5.10/drivers/gpu/drm/
Ddrm_gem_cma_helper.c3 * drm gem CMA (contiguous memory allocator) helper functions
26 * DOC: cma helpers
31 * The DRM GEM/CMA helpers use this allocator as a means to provide buffer
37 * __drm_gem_cma_create - Create a GEM CMA object without allocating memory
41 * This function creates and initializes a GEM CMA object of the given size,
85 * This function creates a CMA GEM object and allocates a contiguous chunk of
130 * This function creates a CMA GEM object, allocating a physically contiguous
167 * drm_gem_cma_free_object - free resources associated with a CMA GEM object
170 * This function frees the backing memory of the CMA GEM object, cleans up the
173 * Drivers using the CMA helpers should set this as their
[all …]
Ddrm_fb_cma_helper.c3 * drm kms/fb cma (contiguous memory allocator) helper functions
21 * DOC: framebuffer cma helper functions
23 * Provides helper functions for creating a cma (contiguous memory allocator)
27 * callback function to create a cma backed framebuffer.
31 * drm_fb_cma_get_gem_obj() - Get CMA GEM object for framebuffer
35 * Return the CMA GEM object for given framebuffer.
59 * Return the CMA GEM address for given framebuffer.
/kernel/linux/linux-6.6/drivers/dma-buf/heaps/
Dcma_heap.c3 * DMABUF CMA heap exporter
12 #include <linux/cma.h>
28 struct cma *cma; member
259 cma_release(cma_heap->cma, buffer->cma_pages, buffer->pagecount); in cma_heap_dma_buf_release()
303 cma_pages = cma_alloc(cma_heap->cma, pagecount, align, false); in cma_heap_allocate()
307 /* Clear the cma pages */ in cma_heap_allocate()
359 cma_release(cma_heap->cma, cma_pages, pagecount); in cma_heap_allocate()
370 static int __add_cma_heap(struct cma *cma, void *data) in __add_cma_heap() argument
378 cma_heap->cma = cma; in __add_cma_heap()
380 exp_info.name = cma_get_name(cma); in __add_cma_heap()
[all …]
/kernel/linux/linux-5.10/include/drm/
Ddrm_gem_cma_helper.h12 * struct drm_gem_cma_object - GEM object backed by CMA memory allocations
25 /* For objects with DMA memory allocated by GEM CMA */
40 * DEFINE_DRM_GEM_CMA_FOPS() - macro to generate file operations for CMA drivers
43 * This macro autogenerates a suitable &struct file_operations for CMA based
113 * DRM_GEM_CMA_DRIVER_OPS_WITH_DUMB_CREATE - CMA GEM driver operations
134 * DRM_GEM_CMA_DRIVER_OPS - CMA GEM driver operations
149 * DRM_GEM_CMA_DRIVER_OPS_VMAP_WITH_DUMB_CREATE - CMA GEM driver operations
173 * DRM_GEM_CMA_DRIVER_OPS_VMAP - CMA GEM driver operations ensuring a virtual
/kernel/linux/build/test/kernel_ltp/syscalls/cma/
DBUILD.gn19 sources = [ "//third_party/ltp/testcases/kernel/syscalls/cma/process_vm01.c" ]
25 [ "//third_party/ltp/testcases/kernel/syscalls/cma/process_vm_readv02.c" ]
31 [ "//third_party/ltp/testcases/kernel/syscalls/cma/process_vm_readv03.c" ]
37 "//third_party/ltp/testcases/kernel/syscalls/cma/process_vm_writev02.c",

12345678910>>...13