The Contiguous Memory Allocator framework
Subsystems (14)
v6 cover The Contiguous Memory Allocator framework
Hello everyone,
A few people asked about CMA at the LPC, so even though the I have not yet finished working on the new CMA here it is so that all interested parties can take a look and decide if it can be used for their use case.
In particular, this version adds not yet completed support for memory migration and cma_pin()/cma_unpin() calls.
For those who have not yet stumbled across CMA an excerpt from documentation:
The Contiguous Memory Allocator (CMA) is a framework, which allows setting up a machine-specific configuration for physically-contiguous memory management. Memory for devices is then allocated according to that configuration.
The main role of the framework is not to allocate memory, but to parse and manage memory configurations, as well as to act as an in-between between device drivers and pluggable allocators. It is thus not tied to any memory allocation method or strategy.
For more information please refer to the fourth patch from the patchset which contains the documentation.
Links to the previous versions of the patch set:
v5: (intentionally left out as CMA v5 was identical to CMA v4)
v4: <http://article.gmane.org/gmane.linux.kernel.mm/52010/>
v3: <http://article.gmane.org/gmane.linux.kernel.mm/51573/>
v2: <http://article.gmane.org/gmane.linux.kernel.mm/50986/>
v1: <http://article.gmane.org/gmane.linux.kernel.mm/50669/>
Changelog:
v6: 1. Most importantly, v6 introduces support for memory migration.
The implementation is not yet complete though.
Migration support means that when CMA is not using memory reserved for it, page allocator can allocate pages from it. When CMA wants to use the memory, the pages have to be moved and/or evicted as to make room for CMA.
To make it possible it must be guaranteed that only movable and reclaimable pages are allocated in CMA controlled regions. This is done by introducing a MIGRATE_CMA migrate type that guarantees exactly that.
Some of the migration code is "borrowed" from Kamezawa Hiroyuki's alloc_contig_pages() implementation. The main difference is that thanks to MIGRATE_CMA migrate type CMA assumes that memory controlled by CMA are is always movable or reclaimable so that it makes allocation decisions regardless of the whether some pages are actually allocated and migrates them if needed.
The most interesting patches from the patchset that implement the functionality are:
09/13: mm: alloc_contig_free_pages() added 10/13: mm: MIGRATE_CMA migration type added 11/13: mm: MIGRATE_CMA isolation functions added 12/13: mm: cma: Migration support added [wip]
Currently, kernel panics in some situations which I am trying to investigate.
2. cma_pin() and cma_unpin() functions has been added (after a conversation with Johan Mossberg). The idea is that whenever hardware does not use the memory (no transaction is on) the chunk can be moved around. This would allow defragmentation to be implemented if desired. No defragmentation algorithm is provided at this time.
3. Sysfs support has been replaced with debugfs. I always felt unsure about the sysfs interface and when Greg KH pointed it out I finally got to rewrite it to debugfs.
v5: (intentionally left out as CMA v5 was identical to CMA v4)
v4: 1. The "asterisk" flag has been removed in favour of requiring
that platform will provide a "*=<regions>" rule in the map attribute.
2. The terminology has been changed slightly renaming "kind" to "type" of memory. In the previous revisions, the documentation indicated that device drivers define memory kinds and now,
v3: 1. The command line parameters have been removed (and moved to
a separate patch, the fourth one). As a consequence, the cma_set_defaults() function has been changed -- it no longer accepts a string with list of regions but an array of regions.
2. The "asterisk" attribute has been removed. Now, each region has an "asterisk" flag which lets one specify whether this region should by considered "asterisk" region.
3. SysFS support has been moved to a separate patch (the third one in the series) and now also includes list of regions.
v2: 1. The "cma_map" command line have been removed. In exchange,
a SysFS entry has been created under kernel/mm/contiguous.
The intended way of specifying the attributes is
a cma_set_defaults() function called by platform initialisation code. "regions" attribute (the string specified by "cma" command line parameter) can be overwritten with command line parameter; the other attributes can be changed during run-time using the SysFS entries.
2. The behaviour of the "map" attribute has been modified slightly. Currently, if no rule matches given device it is assigned regions specified by the "asterisk" attribute. It is by default built from the region names given in "regions" attribute.
3. Devices can register private regions as well as regions that can be shared but are not reserved using standard CMA mechanisms. A private region has no name and can be accessed only by devices that have the pointer to it.
4. The way allocators are registered has changed. Currently, a cma_allocator_register() function is used for that purpose. Moreover, allocators are attached to regions the first time memory is registered from the region or when allocator is registered which means that allocators can be dynamic modules that are loaded after the kernel booted (of course, it won't be possible to allocate a chunk of memory from a region if allocator is not loaded).
5. Index of new functions:
+static inline dma_addr_t __must_check +cma_alloc_from(const char *regions, size_t size,
+ dma_addr_t alignment)
+static inline int
+cma_info_about(struct cma_info *info, const const char *regions)
+int __must_check cma_region_register(struct cma_region *reg);
+dma_addr_t __must_check +cma_alloc_from_region(struct cma_region *reg,
+ size_t size, dma_addr_t alignment);
+static inline dma_addr_t __must_check
+cma_alloc_from(const char *regions,
+ size_t size, dma_addr_t alignment);
+int cma_allocator_register(struct cma_allocator *alloc);
The whole patch set includes the following patches:
lib: rbtree: rb_root_init() function added
lib: bitmap: Added alignment offset for bitmap_find_next_zero_area()
lib: genalloc: Generic allocator improvements
The above three are not really related to the CMA as such, they only modify various library routines which are then used by CMA.
mm: cma: Contiguous Memory Allocator added
This is the main file implementing CMA. No migration support here. Half of the patch is documentation and header file with kernel-doc so it may be worth a while reading if you're interested.
mm: cma: debugfs support added
This adds debugfs support to CMA. This patch is not really important so you can safely skip it if you are in a hurry. ;)
mm: cma: Best-fit algorithm added
This adds a best-fit allocator. Again, this patch is not that important even though it shows how a custom allocator can be implemented and added to the CMA framework.
mm: cma: Test device and application added
A simple "testing" device and application. This lets allocate chunks form user space as to test basic functionality. Once again, you may safely ignore this patch.
mm: move some functions to page_isolation.c
This is Kamezawa Hiroyuki's patch. It moves some code migration related code from mm/memory_hotplug.c to mm/page_isolation.c so that it can be used even if memory hotplug is not enabled.
mm: alloc_contig_free_pages() added
This is taken from KAMEZAWA Hiroyuki's patch. It implements an alloc_contig_free_pages() and free_contig_pages() functions. The first one allocates a range of pages and the second frees them. The pages that are allocated must be in buddy system.
mm: MIGRATE_CMA migration type added
This patch adds a new migration type: MIGRATE_CMA. It's characteristics is that only movable and reclaimable pages can be allocated from MIGRATE_CMA marked pageblock and once pageblokc's migrate type is set to MIGRATE_CMA it is never changed by page allocator to anything else.
mm: MIGRATE_CMA isolation functions added
This changes several functions that change pageblock migrate type to MIGRATE_MOVABLE to take an argument which specifies what type to change pageblock's migrate type to. This is then used with MIGRATE_CMA pageblocks.
mm: cma: Migration support added [wip]
This adds support for migrating pages from CMA managed regions. This means, that when CMA is not using part of the region it is given to the page allocator to use.
ARM: cma: Added CMA to Aquila, Goni and c210 universal boards
This commit adds support for CMA to three ARM boards.
Documentation/00-INDEX | 2 + Documentation/contiguous-memory.txt | 577 +++++++++ arch/arm/mach-s5pv210/mach-aquila.c | 26 + arch/arm/mach-s5pv210/mach-goni.c | 26 + arch/arm/mach-s5pv310/mach-universal_c210.c | 17 + drivers/misc/Kconfig | 8 + drivers/misc/Makefile | 1 + drivers/misc/cma-dev.c | 263 +++++ include/linux/bitmap.h | 24 +- include/linux/cma.h | 569 +++++++++ include/linux/genalloc.h | 46 +- include/linux/mmzone.h | 30 +- include/linux/page-isolation.h | 47 +- include/linux/rbtree.h | 11 + lib/bitmap.c | 22 +- lib/genalloc.c | 182 ++-- mm/Kconfig | 98 ++ mm/Makefile | 2 + mm/cma-best-fit.c | 382 ++++++ mm/cma.c | 1671 +++++++++++++++++++++++++++ mm/compaction.c | 10 + mm/internal.h | 3 + mm/memory_hotplug.c | 108 -- mm/page_alloc.c | 131 ++- mm/page_isolation.c | 126 ++- tools/cma/cma-test.c | 459 ++++++++ 26 files changed, 4575 insertions(+), 266 deletions(-) create mode 100644 Documentation/contiguous-memory.txt create mode 100644 drivers/misc/cma-dev.c create mode 100644 include/linux/cma.h create mode 100644 mm/cma-best-fit.c create mode 100644 mm/cma.c create mode 100644 tools/cma/cma-test.c
Signature · 1 line
1.7.2.3
RFC v6 1/13 lib: rbtree: rb_root_init() function added
Added a rb_root_init() function which initialises a rb_root structure as a red-black tree with at most one element. The rationale is that using rb_root_init(root, node) is more straightforward and cleaner then first initialising and empty tree followed by an insert operation.
--- include/linux/rbtree.h | 11 +++++++++++ 1 files changed, 11 insertions(+), 0 deletions(-)
include/linux/rbtree.h +11 -0
@@ -130,6 +130,17 @@ static inline void rb_set_color(struct rb_node *rb, int color) }#define RB_ROOT (struct rb_root) { NULL, } + +static inline void rb_root_init (struct rb_root *root,struct rb_node *node) +{ + root->rb_node = node; +if (node) { + node->rb_parent_color =RB_BLACK ;/* black, no parent */ + node->rb_left =NULL ; + node->rb_right =NULL ; + } +} +#define rb_entry (ptr, type, member) container_of(ptr, type, member)#define RB_EMPTY_ROOT (root) ((root)->rb_node == NULL)
Signature · 1 line
1.7.2.3
RFC v6 2/13 lib: bitmap: Added alignment offset for bitmap_find_next_zero_area()
In reply to Michal NazarewiczThis commit adds a bitmap_find_next_zero_area_off() function which works like bitmap_find_next_zero_area() function expect it allows an offset to be specified when alignment is checked. This lets caller request a bit such that its number plus the offset is aligned according to the mask.
--- include/linux/bitmap.h | 24 +++++++++++++++++++----- lib/bitmap.c | 22 ++++++++++++---------- 2 files changed, 31 insertions(+), 15 deletions(-)
include/linux/bitmap.h +19 -5
@@ -45,6 +45,7 @@* bitmap_set(dst, pos, nbits) Set specified bit area * bitmap_clear(dst, pos, nbits) Clear specified bit area * bitmap_find_next_zero_area(buf, len, pos, n, mask) Find bit free area +* bitmap_find_next_zero_area_off(buf, len, pos, n, mask) as above * bitmap_shift_right(dst, src, n, nbits) *dst = *src >> n * bitmap_shift_left(dst, src, n, nbits) *dst = *src << n * bitmap_remap(dst, src, old, new, nbits) *dst = map(old, new)(src)
@@ -113,11 +114,24 @@ extern int __bitmap_weight(const unsigned long *bitmap, int bits);extern void bitmap_set (unsigned long *map,int i,int len);extern void bitmap_clear (unsigned long *map,int start,int nr); -extern unsigned long bitmap_find_next_zero_area (unsigned long *map, -unsigned long size, -unsigned long start, -unsigned int nr, -unsigned long align_mask); + +extern unsigned long bitmap_find_next_zero_area_off (unsigned long *map, +unsigned long size, +unsigned long start, +unsigned int nr, +unsigned long align_mask, +unsigned long align_offset); + +static inline unsigned long +bitmap_find_next_zero_area (unsigned long *map, +unsigned long size, +unsigned long start, +unsigned int nr, +unsigned long align_mask) +{ +return bitmap_find_next_zero_area_off (map, size, start, nr, + align_mask,0 ); +}extern int bitmap_scnprintf (char *buf,unsigned int len,const unsigned long *src,int nbits);
lib/bitmap.c +12 -10
@@ -315,30 +315,32 @@ void bitmap_clear(unsigned long *map, int start, int nr) }EXPORT_SYMBOL (bitmap_clear); -/* +/** * bitmap_find_next_zero_area - find a contiguous aligned zero area * @map: The address to base the search on * @size: The bitmap size in bits * @start: The bitnumber to start searching at * @nr: The number of zeroed bits we're looking for * @align_mask: Alignment mask for zero area +* @align_offset: Alignment offset for zero area. * * The @align_mask should be one less than a power of 2; the effect is that -* the bit offset of all zero areas this function finds is multiples of that -* power of 2. A @align_mask of 0 means no alignment is required. +* the bit offset of all zero areas this function finds plus @align_offset +* is multiple of that power of 2. */ -unsigned long bitmap_find_next_zero_area (unsigned long *map, -unsigned long size, -unsigned long start, -unsigned int nr, -unsigned long align_mask) +unsigned long bitmap_find_next_zero_area_off (unsigned long *map, +unsigned long size, +unsigned long start, +unsigned int nr, +unsigned long align_mask, +unsigned long align_offset) {unsigned long index, end, i; again: index =find_next_zero_bit (map, size, start);/* Align allocation */ - index =__ALIGN_MASK (index, align_mask); + index =__ALIGN_MASK (index + align_offset, align_mask) - align_offset; end = index + nr;if (end > size)
@@ -350,7 +352,7 @@ again: }return index; } -EXPORT_SYMBOL (bitmap_find_next_zero_area); +EXPORT_SYMBOL (bitmap_find_next_zero_area_off);/* * Bitmap printing & parsing functions: first version by Bill Irwin,
Signature · 1 line
1.7.2.3
RFC v6 3/13 lib: genalloc: Generic allocator improvements
In reply to Michal NazarewiczThis commit adds a gen_pool_alloc_aligned() function to the generic allocator API. It allows specifying alignment for the allocated block. This feature uses
the bitmap_find_next_zero_area_off() function.
It also fixes possible issue with bitmap's last element being not fully allocated (ie. space allocated for chunk->bits is not a multiple of sizeof(long)).
It also makes some other smaller changes:
- moves structure definitions out of the header file,
- adds __must_check to functions returning value,
- makes gen_pool_add() return -ENOMEM rater than -1 on error,
- changes list_for_each to list_for_each_entry, and
- makes use of bitmap_clear().
--- include/linux/genalloc.h | 46 ++++++------ lib/genalloc.c | 182 ++++++++++++++++++++++++++------------------- 2 files changed, 129 insertions(+), 99 deletions(-)
include/linux/genalloc.h +24 -22
@@ -8,29 +8,31 @@* Version 2. See the file COPYING for more details. */ +struct gen_pool ; -/* -* General purpose special memory pool descriptor. -*/ -struct gen_pool { -rwlock_t lock; -struct list_head chunks;/* list of chunks in this pool */ -int min_alloc_order;/* minimum allocation order */ -}; +struct gen_pool *__must_check gen_pool_create (unsigned order,int nid); -/* -* General purpose special memory pool chunk descriptor. +int __must_check gen_pool_add (struct gen_pool *pool,unsigned long addr, +size_t size,int nid); + +void gen_pool_destroy (struct gen_pool *pool); + +unsigned long __must_check +gen_pool_alloc_aligned (struct gen_pool *pool,size_t size, +unsigned alignment_order); + +/** +* gen_pool_alloc() - allocate special memory from the pool +* @pool: Pool to allocate from. +* @size: Number of bytes to allocate from the pool. +* +* Allocate the requested number of bytes from the specified pool. +* Uses a first-fit algorithm. */ -struct gen_pool_chunk { -spinlock_t lock; -struct list_head next_chunk;/* next chunk in pool */ -unsigned long start_addr;/* starting address of memory chunk */ -unsigned long end_addr;/* ending address of memory chunk */ -unsigned long bits[0 ];/* bitmap for allocating memory chunk */ -}; +static inline unsigned long __must_check +gen_pool_alloc (struct gen_pool *pool,size_t size) +{ +return gen_pool_alloc_aligned (pool, size,0 ); +} -extern struct gen_pool *gen_pool_create (int ,int ); -extern int gen_pool_add (struct gen_pool *,unsigned long ,size_t ,int ); -extern void gen_pool_destroy (struct gen_pool *); -extern unsigned long gen_pool_alloc (struct gen_pool *,size_t ); -extern void gen_pool_free (struct gen_pool *,unsigned long ,size_t ); +void gen_pool_free (struct gen_pool *pool,unsigned long addr,size_t size);
lib/genalloc.c +105 -77
274 lines not on this page · raw message
Signature · 1 line
1.7.2.3
RFC v6 4/13 mm: cma: Contiguous Memory Allocator added
In reply to Michal NazarewiczThe Contiguous Memory Allocator framework is a set of APIs for allocating physically contiguous chunks of memory.
Various chips require contiguous blocks of memory to operate. Those chips include devices such as cameras, hardware video decoders and encoders, etc.
The code is highly modular and customisable to suit the needs of various users. Set of regions reserved for CMA can be configured per-platform and it is easy to add custom allocator algorithms if one has such need.
--- Documentation/00-INDEX | 2 + Documentation/contiguous-memory.txt | 573 +++++++++++++++++++++ include/linux/cma.h | 488 ++++++++++++++++++ mm/Kconfig | 41 ++ mm/Makefile | 1 + mm/cma.c | 933 +++++++++++++++++++++++++++++++++++ 6 files changed, 2038 insertions(+), 0 deletions(-) create mode 100644 Documentation/contiguous-memory.txt create mode 100644 include/linux/cma.h create mode 100644 mm/cma.c
Documentation/00-INDEX +2 -0
@@ -94,6 +94,8 @@ connector/ - docs on the netlink based userspace<->kernel space communication mod. console/ - documentation on Linux console drivers. +contiguous-memory.txt + - documentation on physically-contiguous memory allocation framework. cpu-freq/ - info on CPU frequency and voltage scaling. cpu-hotplug.txt
Documentation/contiguous-memory.txt new file +573 -0
573 lines not on this page · raw message
include/linux/cma.h new file +488 -0
488 lines not on this page · raw message
mm/Kconfig +41 -0
44 lines not on this page · raw message
mm/Makefile +1 -0
@@ -43,3 +43,4 @@ obj-$(CONFIG_HWPOISON_INJECT) += hwpoison-inject.o obj-$(CONFIG_DEBUG_KMEMLEAK) += kmemleak.o obj-$(CONFIG_DEBUG_KMEMLEAK_TEST) += kmemleak-test.o obj-$(CONFIG_CLEANCACHE) += cleancache.o +obj-$(CONFIG_CMA) += cma.o
mm/cma.c new file +933 -0
933 lines not on this page · raw message
Signature · 1 line
1.7.2.3
RFC v6 5/13 mm: cma: debugfs support added
In reply to Michal NazarewiczThe debugfs development interface lets one change the map attribute at run time as well as observe what regions have been reserved.
--- Documentation/contiguous-memory.txt | 4 + include/linux/cma.h | 11 + mm/Kconfig | 25 ++- mm/cma.c | 501 ++++++++++++++++++++++++++++++++++- 4 files changed, 537 insertions(+), 4 deletions(-)
Documentation/contiguous-memory.txt +4 -0
@@ -258,6 +258,10 @@ iff it matched in previous pattern. If the second part is omitted it will mach any type of memory requested by device. + If debugfs support is enabled, this attribute is accessible via + debugfs and can be changed at run-time by writing to + contiguous/map. + Some examples (whitespace added for better readability): cma_map = foo/quaz = r1;
include/linux/cma.h +11 -0
@@ -24,6 +24,7 @@struct device ;struct cma_info ; +struct dentry ;/** * struct cma - an allocated contiguous chunk of memory.
@@ -276,6 +277,11 @@ struct cma_region {unsigned users;struct list_head list; +#if definedCONFIG_CMA_DEBUGFS +const char *to_alloc_link, *from_alloc_link; +struct dentry *dir, *to_alloc, *from_alloc; +#endif + unsigned used:1; unsigned registered:1; unsigned reserved:1;
@@ -382,6 +388,11 @@ struct cma_allocator {void (*unpin)(struct cma *chunk);struct list_head list; + +#if definedCONFIG_CMA_DEBUGFS +const char *dir_name; +struct dentry *regs_dir; +#endif };/**
mm/Kconfig +22 -3
@@ -351,16 +351,35 @@ config CMA For more information see <Documentation/contiguous-memory.txt>. If unsure, say "n". -config CMA_DEBUG - bool "CMA debug messages (DEVELOPEMENT)" +config CMA_DEVELOPEMENT + bool "Include CMA developement features" depends on CMA help + This lets you enable some developement features of the CMA + framework. It does not add any code to the kernel. + + Those options are mostly usable during development and testing. + If unsure, say "n". + +config CMA_DEBUG + bool "CMA debug messages" + depends on CMA_DEVELOPEMENT + help Turns on debug messages in CMA. This produces KERN_DEBUG messages for every CMA call as well as various messages while processing calls such as cma_alloc(). This option does not affect warning and error messages. - This is mostly used during development. If unsure, say "n". +config CMA_DEBUGFS + bool "CMA debugfs interface support" + depends on CMA_DEVELOPEMENT && DEBUG_FS + help + Enable support for debugfs interface. It is available under the + "contiguous" directory in the debugfs root directory. Each + region and allocator is represented there. + + For more information consult + <Documentation/contiguous-memory.txt>. config CMA_GENERIC_ALLOCATOR bool "CMA generic allocator"
mm/cma.c +500 -1
546 lines not on this page · raw message
Signature · 1 line
1.7.2.3
RFC v6 6/13 mm: cma: Best-fit algorithm added
In reply to Michal NazarewiczThis commits adds a best-fit algorithm to the set of algorithms supported by the CMA.
--- mm/Kconfig | 16 ++- mm/Makefile | 1 + mm/cma-best-fit.c | 372 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 388 insertions(+), 1 deletions(-) create mode 100644 mm/cma-best-fit.c
mm/Kconfig +15 -1
@@ -332,10 +332,13 @@ config CLEANCACHE If unsure, say Y to enable cleancache +config CMA_HAS_ALLOCATOR + bool + config CMA bool "Contiguous Memory Allocator framework" # Currently there is only one allocator so force it on - select CMA_GENERIC_ALLOCATOR + select CMA_GENERIC_ALLOCATOR if !CMA_HAS_ALLOCATOR help This enables the Contiguous Memory Allocator framework which allows drivers to allocate big physically-contiguous blocks of
@@ -391,3 +394,14 @@ config CMA_GENERIC_ALLOCATOR implementations: the first-fit, bitmap-based algorithm or a best-fit, red-black tree-based algorithm. The algorithm can be changed under "Library routines". + +config CMA_BEST_FIT + bool "CMA best-fit allocator" + depends on CMA + select CMA_HAS_ALLOCATOR + help + This is a best-fit algorithm running in O(n log n) time where + n is the number of existing holes (which is never greater then + the number of allocated regions and usually much smaller). It + allocates area from the smallest hole that is big enough for + allocation in question.
mm/Makefile +1 -0
@@ -44,3 +44,4 @@ obj-$(CONFIG_DEBUG_KMEMLEAK) += kmemleak.o obj-$(CONFIG_DEBUG_KMEMLEAK_TEST) += kmemleak-test.o obj-$(CONFIG_CLEANCACHE) += cleancache.o obj-$(CONFIG_CMA) += cma.o +obj-$(CONFIG_CMA_BEST_FIT) += cma-best-fit.o
mm/cma-best-fit.c new file +372 -0
372 lines not on this page · raw message
Signature · 1 line
1.7.2.3
RFC v6 7/13 mm: cma: Test device and application added
In reply to Michal NazarewiczThis patch adds a "cma" misc device which lets user space use the CMA API. This device is meant for testing. A testing application is also provided.
--- drivers/misc/Kconfig | 8 + drivers/misc/Makefile | 1 + drivers/misc/cma-dev.c | 263 +++++++++++++++++++++++++++ include/linux/cma.h | 40 +++++ tools/cma/cma-test.c | 459 ++++++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 771 insertions(+), 0 deletions(-) create mode 100644 drivers/misc/cma-dev.c create mode 100644 tools/cma/cma-test.c
drivers/misc/Kconfig +8 -0
@@ -458,4 +458,12 @@ source "drivers/misc/cb710/Kconfig" source "drivers/misc/iwmc3200top/Kconfig" source "drivers/misc/ti-st/Kconfig" +config CMA_DEVICE + tristate "CMA misc device (DEVELOPEMENT)" + depends on CMA_DEVELOPEMENT + help + The CMA misc device allows allocating contiguous memory areas + from user space. This is mostly for testing of the CMA + framework. + endif # MISC_DEVICES
drivers/misc/Makefile +1 -0
@@ -42,3 +42,4 @@ obj-$(CONFIG_ARM_CHARLCD) += arm-charlcd.o obj-$(CONFIG_PCH_PHUB) += pch_phub.o obj-y += ti-st/ obj-$(CONFIG_AB8500_PWM) += ab8500-pwm.o +obj-$(CONFIG_CMA_DEVICE) += cma-dev.o
drivers/misc/cma-dev.c new file +263 -0
263 lines not on this page · raw message
include/linux/cma.h +40 -0
@@ -11,6 +11,46 @@* See Documentation/contiguous-memory.txt for details. */ +#include <linux/ioctl.h> +#include <linux/types.h> + + +#define CMA_MAGIC (('c' << 24) | ('M' << 16) | ('a' << 8) | 0x42) + +enum { +CMA_REQ_DEV_KIND , +CMA_REQ_FROM_REG +}; + +/** +* An information about area exportable to user space. +* @magic: must always be CMA_MAGIC. +* @type: type of the request. +* @spec: either "dev/kind\0" or "regions\0" depending on @type. +* In any case, the string must be NUL terminated. +* additionally, in the latter case scanning stops at +* semicolon (';'). +* @size: size of the chunk to allocate. +* @alignment: desired alignment of the chunk (must be power of two or zero). +* @start: when ioctl() finishes this stores physical address of the chunk. +*/ +struct cma_alloc_request { +__u32 magic; +__u32 type; + +/* __u64 to be compatible accross 32 and 64 bit systems. */ +__u64 size; +__u64 alignment; +__u64 start; + +char spec[32 ]; +}; + +#define IOCTL_CMA_ALLOC _IOWR('p', 0, struct cma_alloc_request) +#define IOCTL_CMA_PATTERN _IO('p', 1) +#define IOCTL_CMA_DUMP _IO('p', 2) + +/***************************** Kernel level API *****************************/ #if defined __KERNEL__ && definedCONFIG_CMA
tools/cma/cma-test.c new file +459 -0
459 lines not on this page · raw message
Signature · 1 line
1.7.2.3
RFC v6 8/13 mm: move some functions to page_isolation.c
In reply to Michal NazarewiczFrom: KAMEZAWA Hiroyuki <[email protected]>
Memory hotplug is a logic for making pages unused in the specified range of pfn. So, some of core logics can be used for other purpose as allocating a very large contigous memory block.
This patch moves some functions from mm/memory_hotplug.c to mm/page_isolation.c. This helps adding a function for large-alloc in page_isolation.c with memory-unplug technique.
Changelog: 2010/10/26
- adjusted to mmotm-1024 + Bob's 3 clean ups.
Changelog: 2010/10/21
- adjusted to mmotm-1020
--- include/linux/page-isolation.h | 7 +++ mm/memory_hotplug.c | 108 -------------------------------------- mm/page_isolation.c | 111 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 118 insertions(+), 108 deletions(-)
include/linux/page-isolation.h +7 -0
@@ -33,5 +33,12 @@ test_pages_isolated(unsigned long start_pfn, unsigned long end_pfn);extern int set_migratetype_isolate (struct page *page);extern void unset_migratetype_isolate (struct page *page); +/* +* For migration. +*/ + +int test_pages_in_a_zone (unsigned long start_pfn,unsigned long end_pfn); +unsigned long scan_lru_pages (unsigned long start,unsigned long end); +int do_migrate_range (unsigned long start_pfn,unsigned long end_pfn);#endif
mm/memory_hotplug.c +0 -108
114 lines not on this page · raw message
mm/page_isolation.c +111 -0
120 lines not on this page · raw message
Signature · 1 line
1.7.2.3
RFC v6 9/13 mm: alloc_contig_free_pages() added
In reply to Michal NazarewiczFrom: KAMEZAWA Hiroyuki <[email protected]>
This commit introduces alloc_contig_free_pages() function which allocates (ie. removes from buddy system) free pages in range. Caller has to guarantee that all pages in range are in buddy system.
Along with alloc_contig_free_pages(), a free_contig_pages() function is provided which frees (or a subset of) pages allocated with alloc_contig_free_pages().
I, Michal Nazarewicz, have modified the alloc_contig_free_pages() function slightly from the original version, mostly to make it easier to allocate note MAX_ORDER aligned pages. This is done by making the function return a pfn of a page one past the one allocated which may be further then caller requested.
--- include/linux/page-isolation.h | 3 ++ mm/page_alloc.c | 42 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+), 0 deletions(-)
include/linux/page-isolation.h +3 -0
@@ -32,6 +32,9 @@ test_pages_isolated(unsigned long start_pfn, unsigned long end_pfn);*/ extern int set_migratetype_isolate (struct page *page);extern void unset_migratetype_isolate (struct page *page); +extern unsigned long alloc_contig_freed_pages (unsigned long start, +unsigned long end,gfp_t flag); +extern void free_contig_pages (struct page *page,int nr_pages);/* * For migration.
mm/page_alloc.c +42 -0
48 lines not on this page · raw message
Signature · 1 line
1.7.2.3
RFC v6 10/13 mm: MIGRATE_CMA migration type added
In reply to Michal NazarewiczThe MIGRATE_CMA migration type has two main characteristics:
(i) only movable and reclaimable pages can be allocated from MIGRATE_CMA page blocks and (ii) page allocator will never change migration type of MIGRATE_CMA page blocks.
This guarantees that page in a MIGRATE_CMA page block can always be freed (by reclaiming it or moving somewhere else).
It is designed to be used with Contiguous Memory Allocator (CMA) for allocating big chunks (eg. 10MiB) of physically contiguous memory. Once driver requests contiguous memory, CMA will migrate or reclaim pages from MIGRATE_CMA page block.
To minimise number of migrations, MIGRATE_CMA migration type is the last type tried when page allocator falls back to other migration types then requested.
To use this new migration type one can use __free_pageblock_cma() function which moves frees a whole page block to a buddy allocator marking it (and thus all pages in it) as MIGRATE_CMA.
--- include/linux/mmzone.h | 30 +++++++++++++---- mm/Kconfig | 9 +++++ mm/compaction.c | 10 ++++++ mm/internal.h | 3 ++ mm/page_alloc.c | 83 +++++++++++++++++++++++++++++++++++++++--------- 5 files changed, 113 insertions(+), 22 deletions(-)
include/linux/mmzone.h +23 -7
@@ -35,13 +35,24 @@*/ #define PAGE_ALLOC_COSTLY_ORDER 3 -#define MIGRATE_UNMOVABLE 0 -#define MIGRATE_RECLAIMABLE 1 -#define MIGRATE_MOVABLE 2 -#define MIGRATE_PCPTYPES 3/* the number of types on the pcp lists */ -#define MIGRATE_RESERVE 3 -#define MIGRATE_ISOLATE 4/* can't allocate from here */ -#define MIGRATE_TYPES 5 +enum { +MIGRATE_UNMOVABLE , +MIGRATE_RECLAIMABLE , +MIGRATE_MOVABLE , +MIGRATE_PCPTYPES ,/* the number of types on the pcp lists */ +MIGRATE_RESERVE =MIGRATE_PCPTYPES , +MIGRATE_ISOLATE ,/* can't allocate from here */ +#ifdef CONFIG_MIGRATE_CMA +MIGRATE_CMA ,/* only movable & reclaimable */ +#endif +MIGRATE_TYPES +}; + +#ifdef CONFIG_MIGRATE_CMA +# define is_migrate_cma (migratetype) unlikely((migratetype) == MIGRATE_CMA) +#else +# define is_migrate_cma (migratetype) false +#endif #define for_each_migratetype_order (order, type) \ for (order = 0; order < MAX_ORDER; order++) \
@@ -54,6 +65,11 @@ static inline int get_pageblock_migratetype(struct page *page)return get_pageblock_flags_group (page, PB_migrate, PB_migrate_end); } +static inline bool is_pageblock_cma (struct page *page) +{ +return is_migrate_cma (get_pageblock_migratetype (page)); +} +struct free_area {struct list_head free_list[MIGRATE_TYPES ];unsigned long nr_free;
mm/Kconfig +9 -0
@@ -1,3 +1,12 @@ +config MIGRATE_CMA + bool + help + This option should be selected by code that requires MIGRATE_CMA + migration type to be present. Once a page block has this + migration type, only movable and reclaimable pages can be + allocated from it and the page block never changes it's + migration type. + config SELECT_MEMORY_MODEL def_bool y depends on EXPERIMENTAL || ARCH_SELECT_MEMORY_MODEL
mm/compaction.c +10 -0
@@ -113,6 +113,16 @@ static bool suitable_migration_target(struct page *page)if (migratetype ==MIGRATE_ISOLATE || migratetype ==MIGRATE_RESERVE )return false; +/* Keep MIGRATE_CMA alone as well. */ +/* +* XXX Revisit. We currently cannot let compaction touch CMA +* pages since compaction insists on changing their migration +* type to MIGRATE_MOVABLE (see split_free_page() called from +* isolate_freepages_block() above). +*/ +if (is_migrate_cma (migratetype)) +return false; +/* If the page is a large free page, then allow migration */ if (PageBuddy (page) &&page_order (page) >= pageblock_order)return true;
mm/internal.h +3 -0
@@ -49,6 +49,9 @@ extern void putback_lru_page(struct page *page);* in mm/page_alloc.c */ extern void __free_pages_bootmem (struct page *page,unsigned int order); +#ifdef CONFIG_MIGRATE_CMA +extern void __free_pageblock_cma (struct page *page); +#endif extern void prep_compound_page (struct page *page,unsigned long order);#ifdef CONFIG_MEMORY_FAILURE extern bool is_free_buddy_page (struct page *page);
mm/page_alloc.c +68 -15
143 lines not on this page · raw message
Signature · 1 line
1.7.2.3
RFC v6 11/13 mm: MIGRATE_CMA isolation functions added
In reply to Michal NazarewiczThis commit changes various functions that change pages and pageblocks migrate type between MIGRATE_ISOLATE and MIGRATE_MOVABLE in such a way as to allow to work with MIGRATE_CMA migrate type.
--- include/linux/page-isolation.h | 39 ++++++++++++++++++++++++++------------- mm/page_alloc.c | 6 +++--- mm/page_isolation.c | 15 ++++++++------- 3 files changed, 37 insertions(+), 23 deletions(-)
include/linux/page-isolation.h +26 -13
@@ -3,35 +3,49 @@/* * Changes migrate type in [start_pfn, end_pfn) to be MIGRATE_ISOLATE. -* If specified range includes migrate types other than MOVABLE, +* If specified range includes migrate types other than MOVABLE or CMA, * this will fail with -EBUSY. * * For isolating all pages in the range finally, the caller have to * free all pages in the range. test_page_isolated() can be used for * test it. */ -extern int -start_isolate_page_range (unsigned long start_pfn,unsigned long end_pfn); +int __start_isolate_page_range (unsigned long start_pfn,unsigned long end_pfn, +unsigned migratetype); + +static inline int +start_isolate_page_range (unsigned long start_pfn,unsigned long end_pfn) +{ +return __start_isolate_page_range (start_pfn, end_pfn,MIGRATE_MOVABLE ); +} + +int __undo_isolate_page_range (unsigned long start_pfn,unsigned long end_pfn, +unsigned migratetype);/* * Changes MIGRATE_ISOLATE to MIGRATE_MOVABLE. * target range is [start_pfn, end_pfn) */ -extern int -undo_isolate_page_range (unsigned long start_pfn,unsigned long end_pfn); +static inline int +undo_isolate_page_range (unsigned long start_pfn,unsigned long end_pfn) +{ +return __undo_isolate_page_range (start_pfn, end_pfn,MIGRATE_MOVABLE ); +}/* -* test all pages in [start_pfn, end_pfn)are isolated or not. +* Test all pages in [start_pfn, end_pfn) are isolated or not. */ -extern int -test_pages_isolated (unsigned long start_pfn,unsigned long end_pfn); +int test_pages_isolated (unsigned long start_pfn,unsigned long end_pfn);/* -* Internal funcs.Changes pageblock's migrate type. -* Please use make_pagetype_isolated()/make_pagetype_movable(). +* Internal functions. Changes pageblock's migrate type. */ -extern int set_migratetype_isolate (struct page *page); -extern void unset_migratetype_isolate (struct page *page); +int set_migratetype_isolate (struct page *page); +void __unset_migratetype_isolate (struct page *page,unsigned migratetype); +static inline void unset_migratetype_isolate (struct page *page) +{ +__unset_migratetype_isolate (page,MIGRATE_MOVABLE ); +}extern unsigned long alloc_contig_freed_pages (unsigned long start,unsigned long end,gfp_t flag);extern void free_contig_pages (struct page *page,int nr_pages);
@@ -39,7 +53,6 @@ extern void free_contig_pages(struct page *page, int nr_pages);/* * For migration. */ -int test_pages_in_a_zone (unsigned long start_pfn,unsigned long end_pfn);unsigned long scan_lru_pages (unsigned long start,unsigned long end);int do_migrate_range (unsigned long start_pfn,unsigned long end_pfn);
mm/page_alloc.c +3 -3
@@ -5463,7 +5463,7 @@ out:return ret; } -void unset_migratetype_isolate (struct page *page) +void __unset_migratetype_isolate (struct page *page,unsigned migratetype) {struct zone *zone;unsigned long flags;
@@ -5471,8 +5471,8 @@ void unset_migratetype_isolate(struct page *page)spin_lock_irqsave (&zone->lock, flags);if (get_pageblock_migratetype (page) !=MIGRATE_ISOLATE ) goto out; -set_pageblock_migratetype (page,MIGRATE_MOVABLE ); -move_freepages_block (zone, page,MIGRATE_MOVABLE ); +set_pageblock_migratetype (page, migratetype); +move_freepages_block (zone, page, migratetype); out:spin_unlock_irqrestore (&zone->lock, flags); }
mm/page_isolation.c +8 -7
@@ -23,10 +23,11 @@ __first_valid_page(unsigned long pfn, unsigned long nr_pages) }/* -* start_isolate_page_range() -- make page-allocation-type of range of pages +* __start_isolate_page_range() -- make page-allocation-type of range of pages * to be MIGRATE_ISOLATE. * @start_pfn: The lower PFN of the range to be isolated. * @end_pfn: The upper PFN of the range to be isolated. +* @migratetype: migrate type to set in error recovery. * * Making page-allocation-type to be MIGRATE_ISOLATE means free pages in * the range will never be allocated. Any free pages and pages freed in the
@@ -35,8 +36,8 @@ __first_valid_page(unsigned long pfn, unsigned long nr_pages)* start_pfn/end_pfn must be aligned to pageblock_order. * Returns 0 on success and -EBUSY if any part of range cannot be isolated. */ -int -start_isolate_page_range (unsigned long start_pfn,unsigned long end_pfn) +int __start_isolate_page_range (unsigned long start_pfn,unsigned long end_pfn, +unsigned migratetype) {unsigned long pfn;unsigned long undo_pfn;
@@ -59,7 +60,7 @@ undo:for (pfn = start_pfn; pfn < undo_pfn; pfn += pageblock_nr_pages) -unset_migratetype_isolate (pfn_to_page (pfn)); +__unset_migratetype_isolate (pfn_to_page (pfn), migratetype);return -EBUSY ; }
@@ -67,8 +68,8 @@ undo:/* * Make isolated pages available again. */ -int -undo_isolate_page_range (unsigned long start_pfn,unsigned long end_pfn) +int __undo_isolate_page_range (unsigned long start_pfn,unsigned long end_pfn, +unsigned migratetype) {unsigned long pfn;struct page *page;
@@ -80,7 +81,7 @@ undo_isolate_page_range(unsigned long start_pfn, unsigned long end_pfn) page =__first_valid_page (pfn, pageblock_nr_pages);if (!page ||get_pageblock_migratetype (page) !=MIGRATE_ISOLATE )continue ; -unset_migratetype_isolate (page); +__unset_migratetype_isolate (page, migratetype); }return 0 ; }
Signature · 1 line
1.7.2.3
RFC v6 12/13 mm: cma: Migration support added [wip]
In reply to Michal NazarewiczThis commits adds cma_early_grab_pageblocks() function as well as makes cma_early_region_reserve() function use the former if some conditions are met.
Grabbed pageblocks are later given back to page allocator with migration type set to MIGRATE_CMA. This guarantees that only movable and reclaimable pages are allocated from those page blocks.
* * * THIS COMMIT IS NOT YET FINISHED * * *
--- include/linux/cma.h | 38 +++++++- mm/Kconfig | 15 +++ mm/cma-best-fit.c | 12 +++- mm/cma.c | 239 +++++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 299 insertions(+), 5 deletions(-)
include/linux/cma.h +34 -4
@@ -310,10 +310,6 @@ struct cma_region {const char *alloc_name;void *private_data; -#ifdef CONFIG_CMA_USE_MIGRATE_CMA -unsigned short *isolation_map; -#endif -unsigned users;struct list_head list;
@@ -327,7 +323,9 @@ struct cma_region { unsigned reserved:1; unsigned copy_name:1; unsigned free_alloc_name:1; +#ifdef CONFIG_CMA_USE_MIGRATE_CMA unsigned use_isolate:1; +#endif };/**
@@ -449,6 +447,38 @@ struct cma_allocator {*/ int cma_allocator_register (struct cma_allocator *alloc); +/** +* __cma_grab() - migrates all pages from range and reserves them for CMA +* @reg: Region this call is made in context of. If the region is +* not marked needing grabbing the function does nothing. +* @start: Address in bytes of the first byte to free. +* @size: Size of the region to free. +* +* This function should be used when allocator wants to allocate some +* physical memory to make sure that it is not used for any movable or +* reclaimable pages (eg. page cache). +* +* In essence, this function migrates all movable and reclaimable +* pages from the range and then removes them from buddy system so +* page allocator won't consider them when allocating space. +* +* The allocator may assume that it is unlikely for this function to fail so +* if it fails allocator should just recover and return error. +*/ +int __cma_grab (struct cma_region *reg,phys_addr_t start,size_t size); + +/** +* cma_ungrab_range() - frees pages from range back to buddy system. +* @reg: Region this call is made in context of. If the region is +* not marked needing grabbing the function does nothing. +* @start: Address in bytes of the first byte to free. +* @size: Size of the region to free. +* +* This is reverse of cma_grab_range(). Allocator should use it when +* physical memory is no longer used. +*/ +void __cma_ungrab (struct cma_region *reg,phys_addr_t start,size_t size); +/**************************** Initialisation API ****************************/
mm/Kconfig +15 -0
@@ -363,6 +363,21 @@ config CMA For more information see <Documentation/contiguous-memory.txt>. If unsure, say "n". +config CMA_USE_MIGRATE_CMA + bool "Use MIGRATE_CMA" + depends on CMA + default y + select MIGRATION + select MIGRATE_CMA + help + This makes CMA use MIGRATE_CMA migration type for regions + maintained by CMA. This makes it possible for standard page + allocator to use pages from such regions. This in turn may + make the whole system run faster as there will be more space + for page caches, etc. + + If unsure, say "y". + config CMA_DEVELOPEMENT bool "Include CMA developement features" depends on CMA
mm/cma-best-fit.c +11 -1
@@ -145,6 +145,8 @@ static void cma_bf_cleanup(struct cma_region *reg)kfree (prv); } +static void __cma_bf_free (struct cma_region *reg,union cma_bf_item *chunk); +struct cma *cma_bf_alloc (struct cma_region *reg,size_t size,unsigned long alignment) {
@@ -281,10 +283,17 @@ case_2: item->chunk.phys = start; item->chunk.size = size; + + ret =__cma_grab (reg, start, size); +if (ret) { +__cma_bf_free (reg, item); +return ERR_PTR (ret); + } +return &item->chunk; } -static void cma_bf_free (struct cma_chunk *chunk) +static void __cma_bf_free (struct cma_region *reg,union cma_bf_item *item) {struct cma_bf_private *prv = reg->private_data;union cma_bf_item *prev;
@@ -350,6 +359,7 @@ next: } } +static void cma_bf_free (struct cma *chunk) {__cma_ungrab (chunk->reg, chunk->phys, chunk->size); __cma_bf_free(chunk->reg,
mm/cma.c +239 -0
275 lines not on this page · raw message
Signature · 1 line
1.7.2.3
RFC v6 13/13 ARM: cma: Added CMA to Aquila, Goni and c210 universal boards
In reply to Michal NazarewiczThis commit adds CMA memory reservation code to Aquila, Goni and c210 universal boards.
--- arch/arm/mach-s5pv210/mach-aquila.c | 26 ++++++++++++++++++++++++++ arch/arm/mach-s5pv210/mach-goni.c | 26 ++++++++++++++++++++++++++ arch/arm/mach-s5pv310/mach-universal_c210.c | 17 +++++++++++++++++ 3 files changed, 69 insertions(+), 0 deletions(-)
arch/arm/mach-s5pv210/mach-aquila.c +26 -0
@@ -21,6 +21,7 @@#include <linux/gpio_keys.h> #include <linux/input.h> #include <linux/gpio.h> +#include <linux/cma.h> #include <asm/mach/arch.h> #include <asm/mach/map.h>
@@ -650,6 +651,30 @@ static void __init aquila_sound_init(void)__raw_writel (__raw_readl (S5P_OTHERS ) | (0x3 <<8 ),S5P_OTHERS ); } +#ifdef CONFIG_CMA + +static void __init aquila_reserve (void ) +{ +static struct cma_region regions[] = { +CMA_REGION ("fw" ,1 <<20 ,128 <<10 ,0x32000000 ), +CMA_REGION ("b1" ,32 <<20 ,0 ,0x33000000 ), +CMA_REGION ("b2" ,16 <<20 ,0 ,0x44000000 ), + { } + }; + +static const char map[]__initconst = +"s5p-mfc5/f=fw;s5p-mfc5/a=b1;s5p-mfc5/b=b2;*=b1,b2" ; + +cma_set_defaults (regions, map); +cma_early_regions_reserve (NULL ); +} + +#else + +#define aquila_reserve NULL + +#endif +static void __init aquila_map_io (void ) {s5p_init_io (NULL ,0 ,S5P_VA_CHIPID );
@@ -690,4 +715,5 @@ MACHINE_START(AQUILA, "Aquila") .map_io = aquila_map_io, .init_machine = aquila_machine_init, .timer = &s3c24xx_timer, + .reserve = aquila_reserve,MACHINE_END
arch/arm/mach-s5pv210/mach-goni.c +26 -0
@@ -25,6 +25,7 @@#include <linux/gpio_keys.h> #include <linux/input.h> #include <linux/gpio.h> +#include <linux/cma.h> #include <asm/mach/arch.h> #include <asm/mach/map.h>
@@ -809,6 +810,30 @@ static void __init goni_sound_init(void)__raw_writel (__raw_readl (S5P_OTHERS ) | (0x3 <<8 ),S5P_OTHERS ); } +#ifdef CONFIG_CMA + +static void __init goni_reserve (void ) +{ +static struct cma_region regions[] = { +CMA_REGION ("fw" ,1 <<20 ,128 <<10 ,0x32000000 ), +CMA_REGION ("b1" ,32 <<20 ,0 ,0x33000000 ), +CMA_REGION ("b2" ,16 <<20 ,0 ,0x44000000 ), + { } + }; + +static const char map[]__initconst = +"s5p-mfc5/f=fw;s5p-mfc5/a=b1;s5p-mfc5/b=b2;*=b1,b2" ; + +cma_set_defaults (regions, map); +cma_early_regions_reserve (NULL ); +} + +#else + +#define goni_reserve NULL + +#endif +static void __init goni_map_io (void ) {s5p_init_io (NULL ,0 ,S5P_VA_CHIPID );
@@ -865,4 +890,5 @@ MACHINE_START(GONI, "GONI") .map_io = goni_map_io, .init_machine = goni_machine_init, .timer = &s3c24xx_timer, + .reserve = goni_reserve,MACHINE_END
arch/arm/mach-s5pv310/mach-universal_c210.c +17 -0
@@ -13,6 +13,7 @@#include <linux/i2c.h> #include <linux/gpio_keys.h> #include <linux/gpio.h> +#include <linux/cma.h> #include <asm/mach/arch.h> #include <asm/mach-types.h>
@@ -138,6 +139,21 @@ static void __init universal_map_io(void)s3c24xx_init_uarts (universal_uartcfgs,ARRAY_SIZE (universal_uartcfgs)); } +static void __init universal_reserve (void ) +{ +static struct cma_region regions[] = { +CMA_REGION ("r" ,64 <<20 ,0 ,0 ), +CMA_REGION ("fw" ,1 <<20 ,128 <<10 ), + { } + }; + +static const char map[]__initconst = +"s3c-mfc5/f=fw;*=r" ; + +cma_set_defaults (regions, map); +cma_early_regions_reserve (NULL ); +} +static void __init universal_machine_init (void ) {i2c_register_board_info (0 , i2c0_devs,ARRAY_SIZE (i2c0_devs));
@@ -152,6 +168,7 @@ MACHINE_START(UNIVERSAL_C210, "UNIVERSAL_C210") .boot_params = S5P_PA_SDRAM + 0x100, .init_irq = s5pv310_init_irq, .map_io = universal_map_io, + .reserve = universal_reserve, .init_machine = universal_machine_init, .timer = &s5pv310_timer,MACHINE_END
Signature · 1 line
1.7.2.3