From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Michal Nazarewicz <m.nazarewicz@samsung.com>
Cc: linux-mm@kvack.org, Daniel Walker <dwalker@codeaurora.org>,
FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>,
Hans Verkuil <hverkuil@xs4all.nl>,
Jonathan Corbet <corbet@lwn.net>,
Kyungmin Park <kyungmin.park@samsung.com>,
Marek Szyprowski <m.szyprowski@samsung.com>,
Mark Brown <broonie@opensource.wolfsonmicro.com>,
Pawel Osciak <p.osciak@samsung.com>,
Russell King <linux@arm.linux.org.uk>,
Zach Pfeffer <zpfeffer@codeaurora.org>,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, linux-media@vger.kernel.org
Subject: Re: [PATCH/RFCv4 3/6] mm: cma: Added SysFS support
Date: Wed, 25 Aug 2010 16:37:08 -0400 [thread overview]
Message-ID: <20100825203707.GB5318@phenom.dumpdata.com> (raw)
In-Reply-To: <9883433f103cc84e55db150806d2270200c74c6b.1282286941.git.m.nazarewicz@samsung.com>
On Fri, Aug 20, 2010 at 11:50:43AM +0200, Michal Nazarewicz wrote:
> The SysFS development interface lets one change the map attribute
> at run time as well as observe what regions have been reserved.
>
> Signed-off-by: Michal Nazarewicz <m.nazarewicz@samsung.com>
> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
> ---
> .../ABI/testing/sysfs-kernel-mm-contiguous | 53 +++
> Documentation/contiguous-memory.txt | 4 +
> include/linux/cma.h | 7 +
> mm/Kconfig | 18 +-
> mm/cma.c | 345 +++++++++++++++++++-
> 5 files changed, 423 insertions(+), 4 deletions(-)
> create mode 100644 Documentation/ABI/testing/sysfs-kernel-mm-contiguous
>
> diff --git a/Documentation/ABI/testing/sysfs-kernel-mm-contiguous b/Documentation/ABI/testing/sysfs-kernel-mm-contiguous
> new file mode 100644
> index 0000000..8df15bc
> --- /dev/null
> +++ b/Documentation/ABI/testing/sysfs-kernel-mm-contiguous
> @@ -0,0 +1,53 @@
> +What: /sys/kernel/mm/contiguous/
> +Date: August 2010
> +Contact: Michal Nazarewicz <m.nazarewicz@samsung.com>
> +Description:
> + If CMA has been built with SysFS support,
> + /sys/kernel/mm/contiguous/ contains a file called
> + "map", a file called "allocators" and a directory
> + called "regions".
> +
> + The "map" file lets one change the CMA's map attribute
> + at run-time.
> +
> + The "allocators" file list all registered allocators.
> + Allocators with no name are listed as a single minus
> + sign.
> +
> + The "regions" directory list all reserved regions.
> +
> + For more details see
> + Documentation/contiguous-memory.txt.
> +
> +What: /sys/kernel/mm/contiguous/regions/
> +Date: August 2010
> +Contact: Michal Nazarewicz <m.nazarewicz@samsung.com>
> +Description:
> + The /sys/kernel/mm/contiguous/regions/ directory
> + contain directories for each registered CMA region.
> + The name of the directory is the same as the start
> + address of the region.
> +
> + If region is named there is also a symbolic link named
> + like the region pointing to the region's directory.
> +
> + Such directory contains the following files:
> +
> + * "name" -- the name of the region or an empty file
> + * "start" -- starting address of the region (formatted
> + with %p, ie. hex).
> + * "size" -- size of the region (in bytes).
> + * "free" -- free space in the region (in bytes).
> + * "users" -- number of chunks allocated in the region.
> + * "alloc" -- name of the allocator.
> +
> + If allocator is not attached to the region, "alloc" is
> + either the name of desired allocator in square
> + brackets (ie. "[foo]") or an empty file if region is
> + to be attached to default allocator. If an allocator
> + is attached to the region. "alloc" is either its name
> + or "-" if attached allocator has no name.
> +
> + If there are no chunks allocated in given region
> + ("users" is "0") then a name of desired allocator can
> + be written to "alloc".
> diff --git a/Documentation/contiguous-memory.txt b/Documentation/contiguous-memory.txt
> index 8fc2400..8d189b8 100644
> --- a/Documentation/contiguous-memory.txt
> +++ b/Documentation/contiguous-memory.txt
> @@ -256,6 +256,10 @@
> iff it matched in previous pattern. If the second part is
> omitted it will mach any type of memory requested by device.
>
> + If SysFS support is enabled, this attribute is accessible via
> + SysFS and can be changed at run-time by writing to
> + /sys/kernel/mm/contiguous/map.
> +
> Some examples (whitespace added for better readability):
>
> cma_map = foo/quaz = r1;
> diff --git a/include/linux/cma.h b/include/linux/cma.h
> index cd63f52..eede28d 100644
> --- a/include/linux/cma.h
> +++ b/include/linux/cma.h
> @@ -17,6 +17,9 @@
>
> #include <linux/rbtree.h>
> #include <linux/list.h>
> +#if defined CONFIG_CMA_SYSFS
> +# include <linux/kobject.h>
> +#endif
>
>
> struct device;
> @@ -203,6 +206,10 @@ struct cma_region {
> unsigned users;
> struct list_head list;
>
> +#if defined CONFIG_CMA_SYSFS
> + struct kobject kobj;
> +#endif
> +
> unsigned used:1;
> unsigned registered:1;
> unsigned reserved:1;
> diff --git a/mm/Kconfig b/mm/Kconfig
> index 3e9317c..ac0bb08 100644
> --- a/mm/Kconfig
> +++ b/mm/Kconfig
> @@ -319,12 +319,26 @@ config CMA
> To make use of CMA you need to specify the regions and
> driver->region mapping on command line when booting the kernel.
>
> -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
> + freamework.
> +
> +config CMA_DEBUG
> + bool "CMA debug messages"
> + depends on CMA_DEVELOPEMENT
> + help
> Enable debug messages in CMA code.
>
> +config CMA_SYSFS
> + bool "CMA SysFS interface support"
> + depends on CMA_DEVELOPEMENT
> + help
> + Enable support for SysFS interface.
Whats the rationale for having those #ifdef CONFIG_CMA_SYSFS sprinkled
in the C code? Is SysFS not used on StrongARM? Why not implicitly include
the SysFS support?
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2010-08-25 20:39 UTC|newest]
Thread overview: 60+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-20 9:50 [PATCH/RFCv4 0/6] The Contiguous Memory Allocator framework Michal Nazarewicz
2010-08-20 9:50 ` [PATCH/RFCv4 1/6] lib: rbtree: rb_root_init() function added Michal Nazarewicz
2010-08-20 9:50 ` [PATCH/RFCv4 2/6] mm: cma: Contiguous Memory Allocator added Michal Nazarewicz
2010-08-20 9:50 ` [PATCH/RFCv4 3/6] mm: cma: Added SysFS support Michal Nazarewicz
2010-08-20 9:50 ` [PATCH/RFCv4 4/6] mm: cma: Added command line parameters support Michal Nazarewicz
2010-08-20 9:50 ` [PATCH/RFCv4 5/6] mm: cma: Test device and application added Michal Nazarewicz
2010-08-20 9:50 ` [PATCH/RFCv4 6/6] arm: Added CMA to Aquila and Goni Michal Nazarewicz
2010-08-25 20:37 ` Konrad Rzeszutek Wilk [this message]
2010-08-26 1:20 ` [PATCH/RFCv4 3/6] mm: cma: Added SysFS support Michał Nazarewicz
2010-08-25 20:32 ` [PATCH/RFCv4 2/6] mm: cma: Contiguous Memory Allocator added Konrad Rzeszutek Wilk
2010-08-26 1:22 ` Michał Nazarewicz
2010-08-26 6:25 ` [PATCH/RFCv4.1 " Michal Nazarewicz
2010-08-26 13:47 ` [PATCH/RFCv4 " Mel Gorman
2010-08-27 2:09 ` Michał Nazarewicz
2010-08-28 12:37 ` Hans Verkuil
2010-08-29 1:48 ` Michał Nazarewicz
2010-08-20 13:15 ` [PATCH/RFCv4 0/6] The Contiguous Memory Allocator framework Peter Zijlstra
2010-08-25 22:58 ` Andrew Morton
2010-08-25 23:26 ` Daniel Walker
2010-08-26 1:38 ` Michał Nazarewicz
2010-08-25 23:31 ` Jonathan Corbet
2010-08-26 1:38 ` Pawel Osciak
2010-08-26 1:49 ` Michał Nazarewicz
2010-08-26 2:49 ` Minchan Kim
2010-08-26 3:04 ` Minchan Kim
2010-08-26 8:20 ` Peter Zijlstra
2010-08-26 9:29 ` Minchan Kim
2010-08-26 10:06 ` Peter Zijlstra
2010-08-26 10:21 ` Minchan Kim
2010-08-26 11:05 ` Peter Zijlstra
2010-08-26 0:58 ` KAMEZAWA Hiroyuki
2010-08-26 2:12 ` Michał Nazarewicz
2010-08-26 2:50 ` KAMEZAWA Hiroyuki
2010-08-26 3:44 ` KAMEZAWA Hiroyuki
2010-08-26 4:01 ` Michał Nazarewicz
2010-08-26 4:39 ` KAMEZAWA Hiroyuki
2010-08-26 5:54 ` Américo Wang
2010-08-26 4:06 ` Minchan Kim
2010-08-26 4:14 ` Minchan Kim
2010-08-26 4:30 ` KAMEZAWA Hiroyuki
2010-08-26 9:36 ` Minchan Kim
2010-08-27 8:16 ` KAMEZAWA Hiroyuki
2010-08-27 8:37 ` Peter Zijlstra
2010-09-02 8:54 ` KAMEZAWA Hiroyuki
2010-09-03 10:29 ` KAMEZAWA Hiroyuki
2010-09-05 15:57 ` Minchan Kim
2010-09-06 0:08 ` KAMEZAWA Hiroyuki
2010-08-26 1:22 ` Pawel Osciak
2010-08-26 2:40 ` Michał Nazarewicz
2010-08-26 8:18 ` Peter Zijlstra
2010-08-26 10:18 ` Mel Gorman
2010-08-28 13:08 ` Hans Verkuil
2010-08-28 13:34 ` Peter Zijlstra
2010-08-28 13:58 ` Hans Verkuil
2010-08-28 14:16 ` Peter Zijlstra
2010-08-30 8:27 ` Clemens Ladisch
2010-08-26 1:28 ` Michał Nazarewicz
2010-08-26 8:17 ` Peter Zijlstra
2010-08-27 2:41 ` Michał Nazarewicz
2010-08-26 10:12 ` Mel Gorman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100825203707.GB5318@phenom.dumpdata.com \
--to=konrad.wilk@oracle.com \
--cc=broonie@opensource.wolfsonmicro.com \
--cc=corbet@lwn.net \
--cc=dwalker@codeaurora.org \
--cc=fujita.tomonori@lab.ntt.co.jp \
--cc=hverkuil@xs4all.nl \
--cc=kyungmin.park@samsung.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linux@arm.linux.org.uk \
--cc=m.nazarewicz@samsung.com \
--cc=m.szyprowski@samsung.com \
--cc=p.osciak@samsung.com \
--cc=zpfeffer@codeaurora.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox