/openbmc/linux/mm/ |
H A D | cma_debug.c | 3 * 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 …]
|
H A D | cma.c | 15 #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 …]
|
H A D | cma_sysfs.c | 3 * 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 …]
|
H A D | cma.h | 10 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 …]
|
H A D | Kconfig | 689 depends on (NUMA || ARCH_ENABLE_MEMORY_HOTREMOVE || COMPACTION || CMA) && MMU 718 def_bool (MEMORY_ISOLATION && COMPACTION) || CMA 919 config CMA config 927 CMA reserves a region of memory and allows only movable pages to 935 bool "CMA debug messages (DEVELOPMENT)" 936 depends on DEBUG_KERNEL && CMA 938 Turns on debug messages in CMA. This produces KERN_DEBUG 939 messages for every CMA call as well as various messages while 944 bool "CMA debugfs interface" 945 depends on CMA && DEBUG_FS [all …]
|
/openbmc/linux/include/linux/ |
H A D | cma.h | 10 * 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 …]
|
H A D | dma-map-ops.h | 13 struct cma; 114 extern struct cma *dma_contiguous_default_area; 116 static inline struct cma *dev_get_cma_area(struct device *dev) in dev_get_cma_area() 125 phys_addr_t limit, struct cma **res_cma, bool fixed); 136 static inline struct cma *dev_get_cma_area(struct device *dev) in dev_get_cma_area() 144 phys_addr_t base, phys_addr_t limit, struct cma **res_cma, in dma_contiguous_reserve_area()
|
/openbmc/linux/Documentation/ABI/testing/ |
H A D | sysfs-kernel-mm-cma | 1 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
|
/openbmc/linux/kernel/dma/ |
H A D | contiguous.c | 11 * 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. 98 early_param("cma", early_cma); 102 static struct cma *dma_contiguous_numa_area[MAX_NUMNODES]; [all …]
|
H A D | Kconfig | 147 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.
|
H A D | pool.c | 6 #include <linux/cma.h> 60 struct cma *cma; in cma_in_zone() local 62 cma = dev_get_cma_area(NULL); in cma_in_zone() 63 if (!cma) in cma_in_zone() 66 size = cma_get_size(cma); in cma_in_zone() 70 /* CMA can't cross zone boundaries, see cma_activate_area() */ in cma_in_zone() 71 end = cma_get_base(cma) + size - 1; in cma_in_zone()
|
/openbmc/linux/Documentation/admin-guide/mm/ |
H A D | cma_debugfs.rst | 2 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.
|
/openbmc/linux/drivers/dma-buf/heaps/ |
H A D | cma_heap.c | 3 * 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 …]
|
H A D | Kconfig | 9 bool "DMA-BUF CMA Heap" 12 Choose this option to enable dma-buf CMA heap. This heap is backed 13 by the Contiguous Memory Allocator (CMA). If your system has these
|
/openbmc/linux/arch/s390/mm/ |
H A D | init.c | 31 #include <linux/cma.h> 232 /* Prevent memory blocks which contain cma regions from going offline */ 239 static int s390_cma_check_range(struct cma *cma, void *data) in s390_cma_check_range() argument 245 start = cma_get_base(cma); in s390_cma_check_range() 246 end = start + cma_get_size(cma); in s390_cma_check_range()
|
/openbmc/linux/Documentation/devicetree/bindings/reserved-memory/ |
H A D | shared-dma-pool.yaml | 47 linux,cma-default: 79 linux,cma { 84 linux,cma-default;
|
/openbmc/linux/arch/xtensa/boot/dts/ |
H A D | kc705.dts | 22 linux,cma { 28 linux,cma-default;
|
/openbmc/u-boot/include/configs/ |
H A D | bcmstb.h | 55 * : [~208 MiB uncompressed max, to CMA/bmem low address] 63 * 0x0f00 0000 Contiguous memory allocator (CMA/bmem) low address 74 * accommodate stblinux's bmem and CMA regions. To accomplish this,
|
/openbmc/linux/Documentation/devicetree/bindings/media/ |
H A D | nuvoton,npcm-vcd.yaml | 46 CMA pool to use for buffers allocation instead of the default CMA pool.
|
H A D | allwinner,sun4i-a10-video-engine.yaml | 63 CMA pool to use for buffers allocation instead of the default 64 CMA pool.
|
/openbmc/linux/Documentation/powerpc/ |
H A D | firmware-assisted-dump.rst | 147 Contiguous Memory Allocator (CMA) for memory reservation if CMA is 148 configured for kernel. With CMA reservation this memory will be 152 that were present in CMA region:: 222 By default, FADump reserved memory will be initialized as CMA area. 224 prevent FADump to use CMA.
|
/openbmc/linux/arch/powerpc/kernel/ |
H A D | fadump.c | 25 #include <linux/cma.h> 68 static struct cma *fadump_cma; 71 * fadump_cma_init() - Initialize CMA area from a fadump reserved memory 73 * This function initializes CMA area from fadump reserved memory. 76 * Initialize only the area equivalent to boot memory size for CMA use. 78 * to CMA and pages for those will stay reserved. boot memory size is 79 * aligned per CMA requirement to satisy cma_init_reserved_mem() call. 92 * Do not use CMA if user has provided fadump=nocma kernel parameter. in fadump_cma_init() 102 pr_err("Failed to init cma area for firmware-assisted dump,%d\n", rc); in fadump_cma_init() 104 * Though the CMA init has failed we still have memory in fadump_cma_init() [all …]
|
/openbmc/u-boot/doc/ |
H A D | README.bcm7xxx | 99 * accommodate stblinux bmem/CMA reservations. 129 * to accommodate stblinux bmem/CMA
|
/openbmc/linux/drivers/gpu/drm/tve200/ |
H A D | Kconfig | 5 depends on CMA
|
/openbmc/linux/drivers/gpu/drm/mcde/ |
H A D | Kconfig | 4 depends on CMA
|