From: Arnd Bergmann <arnd@arndb.de>
To: Marek Szyprowski <m.szyprowski@samsung.com>
Cc: linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-media@vger.kernel.org, linux-mm@kvack.org,
linaro-mm-sig@lists.linaro.org,
'Michal Nazarewicz' <mina86@mina86.com>,
'Kyungmin Park' <kyungmin.park@samsung.com>,
'Andrew Morton' <akpm@linux-foundation.org>,
'KAMEZAWA Hiroyuki' <kamezawa.hiroyu@jp.fujitsu.com>,
'Ankita Garg' <ankita@in.ibm.com>,
'Daniel Walker' <dwalker@codeaurora.org>,
'Mel Gorman' <mel@csn.ul.ie>,
'Jesse Barker' <jesse.barker@linaro.org>
Subject: Re: [PATCH 08/10] mm: cma: Contiguous Memory Allocator added
Date: Wed, 15 Jun 2011 13:14:56 +0200 [thread overview]
Message-ID: <201106151314.57150.arnd@arndb.de> (raw)
In-Reply-To: <000601cc2b32$9e2a4030$da7ec090$%szyprowski@samsung.com>
On Wednesday 15 June 2011, Marek Szyprowski wrote:
> > > If possible I would like to make cma something similar to
> > > declare_dma_coherent()&friends, so the board/platform/bus startup code
> > > will just call declare_dma_contiguous() to enable support for cma for
> > > particular devices.
> >
> > Sounds good, I like that.
>
> Thanks. I thought a bit more on this and decided that I want to make this
> declare_dma_contiguous() optional for the drivers. It should be used only
> for some sophisticated cases like for example our video codec with two
> memory interfaces for 2 separate banks. By default the dma-mapping will
> use system-wide cma pool.
>
> (snipped)
Ok, good.
> > Please explain the exact requirements that lead you to defining multiple
> > contexts. My feeling is that in most cases we don't need them and can
> > simply live with a single area. Depending on how obscure the cases are
> > where we do need something beyond that, we can then come up with
> > special-case solutions for them.
>
> Like it was already stated we need such feature for our multimedia codec
> to allocate buffers from different memory banks. I really don't see any
> problems with the possibility to have additional cma areas for special
> purposes.
It's not a problem for special cases, I just want to make sure that
the common case works well enough that we don't need too many special
cases.
> > The problem with defining CMA areas in the device tree is that it's not
> > a property of the hardware, but really policy. The device tree file
> > should not contain anything related to a specific operating system
> > because you might want to boot something on the board that doesn't
> > know about CMA, and even when you only care about using Linux, the
> > implementation might change to the point where hardcoded CMA areas
> > no longer make sense.
>
> I really doubt that the device tree will carry only system-independent
> information.
So far, this has worked well enough.
> Anyway, the preferred or required memory areas/banks for
> buffer allocation is something that is a property of the hardware not
> the OS policy.
That is true. If there are hard requirements of the hardware, we
can and should definitely document them in the device tree. It's
totally fine to describe the layout of memory banks and affinity
of devices to specific banks where that exists in hardware.
The part that should not be in the device tree is a specific location
of a buffer inside the bank when there is no hardware reason for
the location.
I guess it's also fine to describe requirements per device regarding
how much contiguous memory it will need to operate, if you can provide
that number independent of the application you want to run. The early
boot code can walk the device tree and ensure that the region is
large enough.
> > IMHO we should first aim for a solution that works almost everywhere
> > without the kernel knowing what board it's running on, and then we
> > can add quirks for devices that have special requirements. I think
> > the situation is similar to the vmalloc virtual address space, which
> > normally has a hardcoded size that works almost everywhere, but there
> > are certain drivers etc that require much more, or there are situations
> > where you want to make it smaller in order to avoid highmem.
>
> I'm trying to create something that will fulfill the requirements of my
> hardware, that's why I cannot focus on a generic case only.
Yes, that is the obvious conflict. My main interest is to have something
that works not just for your hardware but works as good as possible on
the widest possible range of hardware, which may mean it may run not quite
as good in some of the cases.
Arnd
--
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/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2011-06-15 11:15 UTC|newest]
Thread overview: 58+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-10 9:54 [PATCHv10 0/10] Contiguous Memory Allocator Marek Szyprowski
2011-06-10 9:54 ` [PATCH 01/10] lib: bitmap: Added alignment offset for bitmap_find_next_zero_area() Marek Szyprowski
2011-06-10 9:54 ` [PATCH 02/10] lib: genalloc: Generic allocator improvements Marek Szyprowski
2011-06-10 11:24 ` Alan Cox
2011-06-10 12:22 ` Marek Szyprowski
2011-06-10 12:52 ` Alan Cox
2011-06-10 17:16 ` Michal Nazarewicz
2011-06-14 15:49 ` [Linaro-mm-sig] " Jordan Crouse
2011-06-10 9:54 ` [PATCH 03/10] mm: move some functions from memory_hotplug.c to page_isolation.c Marek Szyprowski
2011-06-10 9:54 ` [PATCH 04/10] mm: alloc_contig_freed_pages() added Marek Szyprowski
2011-06-10 9:54 ` [PATCH 05/10] mm: alloc_contig_range() added Marek Szyprowski
2011-06-10 9:54 ` [PATCH 06/10] mm: MIGRATE_CMA migration type added Marek Szyprowski
2011-06-10 9:54 ` [PATCH 07/10] mm: MIGRATE_CMA isolation functions added Marek Szyprowski
2011-06-10 9:54 ` [PATCH 08/10] mm: cma: Contiguous Memory Allocator added Marek Szyprowski
2011-06-10 16:21 ` Arnd Bergmann
2011-06-13 9:05 ` Marek Szyprowski
2011-06-14 13:49 ` Arnd Bergmann
2011-06-14 13:55 ` Michal Nazarewicz
2011-06-14 16:03 ` Arnd Bergmann
2011-06-14 16:58 ` Michal Nazarewicz
2011-06-14 18:30 ` Arnd Bergmann
2011-06-14 18:40 ` Michal Nazarewicz
2011-06-15 7:11 ` Marek Szyprowski
2011-06-15 7:37 ` Arnd Bergmann
2011-06-15 8:14 ` Marek Szyprowski
2011-06-16 0:48 ` [Linaro-mm-sig] " Philip Balister
2011-06-16 7:03 ` Arnd Bergmann
2011-06-22 7:03 ` Hans Verkuil
2011-06-22 7:32 ` Michal Nazarewicz
2011-06-22 12:42 ` Arnd Bergmann
2011-06-22 13:15 ` Marek Szyprowski
2011-06-22 13:39 ` Arnd Bergmann
2011-06-22 16:04 ` Michal Nazarewicz
2011-06-22 15:54 ` Michal Nazarewicz
2011-06-15 11:53 ` Daniel Vetter
2011-06-15 13:12 ` Thomas Hellstrom
2011-06-17 16:08 ` Arnd Bergmann
2011-06-14 17:01 ` Daniel Stone
2011-06-14 18:58 ` Zach Pfeffer
2011-06-14 20:42 ` Arnd Bergmann
2011-06-14 21:01 ` Jordan Crouse
2011-06-15 11:27 ` Arnd Bergmann
2011-06-15 8:36 ` Marek Szyprowski
2011-06-15 21:39 ` Larry Bassel
2011-06-15 22:06 ` Arnd Bergmann
2011-06-16 17:01 ` Larry Bassel
2011-06-17 12:45 ` Arnd Bergmann
2011-07-04 5:25 ` Ankita Garg
2011-07-04 14:45 ` Arnd Bergmann
2011-06-16 3:20 ` Zach Pfeffer
2011-06-15 9:26 ` Michal Nazarewicz
2011-06-15 11:20 ` Arnd Bergmann
2011-06-15 11:30 ` Michal Nazarewicz
2011-06-15 6:01 ` Subash Patel
2011-06-15 8:02 ` Marek Szyprowski
2011-06-15 11:14 ` Arnd Bergmann [this message]
2011-06-10 9:54 ` [PATCH 09/10] ARM: integrate CMA with dma-mapping subsystem Marek Szyprowski
2011-06-10 9:54 ` [PATCH 10/10] ARM: S5PV210: add CMA support for FIMC devices on Aquila board Marek Szyprowski
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=201106151314.57150.arnd@arndb.de \
--to=arnd@arndb.de \
--cc=akpm@linux-foundation.org \
--cc=ankita@in.ibm.com \
--cc=dwalker@codeaurora.org \
--cc=jesse.barker@linaro.org \
--cc=kamezawa.hiroyu@jp.fujitsu.com \
--cc=kyungmin.park@samsung.com \
--cc=linaro-mm-sig@lists.linaro.org \
--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=m.szyprowski@samsung.com \
--cc=mel@csn.ul.ie \
--cc=mina86@mina86.com \
/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