All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH/RFCv3 0/6] The Contiguous Memory Allocator framework
@ 2010-08-06 13:22 ` Michal Nazarewicz
  0 siblings, 0 replies; 54+ messages in thread
From: Michal Nazarewicz @ 2010-08-06 13:22 UTC (permalink / raw)
  To: linux-mm
  Cc: Hans Verkuil, Marek Szyprowski, Daniel Walker, Jonathan Corbet,
	Pawel Osciak, Mark Brown, Hiremath Vaibhav, FUJITA Tomonori,
	Kyungmin Park, Zach Pfeffer, Russell King, jaeryul.oh, kgene.kim,
	linux-arm-kernel, linux-media, linux-kernel, Michal Nazarewicz

Hello everyone,

The following patchset implements a Contiguous Memory Allocator.  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 second patch from the
patchset which contains the documentation.


Links to the previous versions of the patchsets:
v2: <http://article.gmane.org/gmane.linux.kernel.mm/50986/>
v1: <http://article.gmane.org/gmane.linux.kernel.mm/50669/>


This is the third version of the patchset.  All of the changes are
concentrated in the second, the third and the fourth patch -- the
other patches are almost identical.


Major observable changes between the second (the previous) and the
third (this) versions are:

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.


Major observable changes between the first and the second versions
are:

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);


Michal Nazarewicz (6):
  lib: rbtree: rb_root_init() function added
  mm: cma: Contiguous Memory Allocator added
  mm: cma: Added SysFS support
  mm: cma: Added command line parameters support
  mm: cma: Test device and application added
  arm: Added CMA to Aquila and Goni

 Documentation/00-INDEX                             |    2 +
 .../ABI/testing/sysfs-kernel-mm-contiguous         |   58 +
 Documentation/contiguous-memory.txt                |  651 +++++++++
 Documentation/kernel-parameters.txt                |    4 +
 arch/arm/mach-s5pv210/mach-aquila.c                |   31 +
 arch/arm/mach-s5pv210/mach-goni.c                  |   31 +
 drivers/misc/Kconfig                               |    8 +
 drivers/misc/Makefile                              |    1 +
 drivers/misc/cma-dev.c                             |  184 +++
 include/linux/cma.h                                |  475 +++++++
 include/linux/rbtree.h                             |   11 +
 mm/Kconfig                                         |   54 +
 mm/Makefile                                        |    2 +
 mm/cma-best-fit.c                                  |  407 ++++++
 mm/cma.c                                           | 1446 ++++++++++++++++++++
 tools/cma/cma-test.c                               |  373 +++++
 16 files changed, 3738 insertions(+), 0 deletions(-)
 create mode 100644 Documentation/ABI/testing/sysfs-kernel-mm-contiguous
 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


^ permalink raw reply	[flat|nested] 54+ messages in thread

end of thread, other threads:[~2010-08-20 10:54 UTC | newest]

Thread overview: 54+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-08-06 13:22 [PATCH/RFCv3 0/6] The Contiguous Memory Allocator framework Michal Nazarewicz
2010-08-06 13:22 ` Michal Nazarewicz
2010-08-06 13:22 ` Michal Nazarewicz
2010-08-06 13:22 ` [PATCH/RFCv3 1/6] lib: rbtree: rb_root_init() function added Michal Nazarewicz
2010-08-06 13:22   ` Michal Nazarewicz
2010-08-06 13:22   ` Michal Nazarewicz
2010-08-06 13:22   ` [PATCH/RFCv3 2/6] mm: cma: Contiguous Memory Allocator added Michal Nazarewicz
2010-08-06 13:22     ` Michal Nazarewicz
2010-08-06 13:22     ` Michal Nazarewicz
2010-08-06 13:22     ` [PATCH/RFCv3 3/6] mm: cma: Added SysFS support Michal Nazarewicz
2010-08-06 13:22       ` Michal Nazarewicz
2010-08-06 13:22       ` Michal Nazarewicz
2010-08-06 13:22       ` [PATCH/RFCv3 4/6] mm: cma: Added command line parameters support Michal Nazarewicz
2010-08-06 13:22         ` Michal Nazarewicz
2010-08-06 13:22         ` Michal Nazarewicz
2010-08-06 13:22         ` [PATCH/RFCv3 5/6] mm: cma: Test device and application added Michal Nazarewicz
2010-08-06 13:22           ` Michal Nazarewicz
2010-08-06 13:22           ` Michal Nazarewicz
2010-08-06 13:22           ` [PATCH/RFCv3 6/6] arm: Added CMA to Aquila and Goni Michal Nazarewicz
2010-08-06 13:22             ` Michal Nazarewicz
2010-08-06 13:22             ` Michal Nazarewicz
2010-08-18  3:01 ` [PATCH/RFCv3 0/6] The Contiguous Memory Allocator framework Kyungmin Park
2010-08-18  3:01   ` Kyungmin Park
2010-08-18  3:01   ` Kyungmin Park
2010-08-19 14:47   ` Konrad Rzeszutek Wilk
2010-08-19 14:47     ` Konrad Rzeszutek Wilk
2010-08-19 14:47     ` Konrad Rzeszutek Wilk
2010-08-20  0:50     ` Michał Nazarewicz
2010-08-20  0:50       ` Michał Nazarewicz
2010-08-20  0:50       ` Michał Nazarewicz
2010-08-19 15:15   ` FUJITA Tomonori
2010-08-19 15:15     ` FUJITA Tomonori
2010-08-19 15:15     ` FUJITA Tomonori
2010-08-20  1:08     ` Michał Nazarewicz
2010-08-20  1:08       ` Michał Nazarewicz
2010-08-20  1:08       ` Michał Nazarewicz
2010-08-20  3:12       ` FUJITA Tomonori
2010-08-20  3:12         ` FUJITA Tomonori
2010-08-20  3:12         ` FUJITA Tomonori
2010-08-20  6:38         ` Michał Nazarewicz
2010-08-20  6:38           ` Michał Nazarewicz
2010-08-20  6:38           ` Michał Nazarewicz
2010-08-20  6:57           ` FUJITA Tomonori
2010-08-20  6:57             ` FUJITA Tomonori
2010-08-20  6:57             ` FUJITA Tomonori
2010-08-20  8:10             ` Michał Nazarewicz
2010-08-20  8:10               ` Michał Nazarewicz
2010-08-20  8:10               ` Michał Nazarewicz
2010-08-20 10:35               ` FUJITA Tomonori
2010-08-20 10:35                 ` FUJITA Tomonori
2010-08-20 10:35                 ` FUJITA Tomonori
2010-08-20 10:54                 ` Michał Nazarewicz
2010-08-20 10:54                   ` Michał Nazarewicz
2010-08-20 10:54                   ` Michał Nazarewicz

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.