[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-id: <006301cc3be4$daab1850$900148f0$%szyprowski@samsung.com>
Date: Wed, 06 Jul 2011 15:58:58 +0200
From: Marek Szyprowski <m.szyprowski@...sung.com>
To: 'Russell King - ARM Linux' <linux@....linux.org.uk>
Cc: linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
linux-media@...r.kernel.org, linux-mm@...ck.org,
linaro-mm-sig@...ts.linaro.org,
'Daniel Walker' <dwalker@...eaurora.org>,
'Arnd Bergmann' <arnd@...db.de>,
'Jonathan Corbet' <corbet@....net>,
'Mel Gorman' <mel@....ul.ie>,
'Chunsang Jeong' <chunsang.jeong@...aro.org>,
'Michal Nazarewicz' <mina86@...a86.com>,
'Jesse Barker' <jesse.barker@...aro.org>,
'Kyungmin Park' <kyungmin.park@...sung.com>,
'Ankita Garg' <ankita@...ibm.com>,
'Andrew Morton' <akpm@...ux-foundation.org>,
'KAMEZAWA Hiroyuki' <kamezawa.hiroyu@...fujitsu.com>,
Marek Szyprowski <m.szyprowski@...sung.com>
Subject: RE: [PATCH 6/8] drivers: add Contiguous Memory Allocator
Hello,
On Tuesday, July 05, 2011 1:34 PM Russell King - ARM Linux wrote:
> On Tue, Jul 05, 2011 at 09:41:48AM +0200, Marek Szyprowski wrote:
> > The Contiguous Memory Allocator is a set of helper functions for DMA
> > mapping framework that improves allocations of contiguous memory chunks.
> >
> > CMA grabs memory on system boot, marks it with CMA_MIGRATE_TYPE and
> > gives back to the system. Kernel is allowed to allocate movable pages
> > within CMA's managed memory so that it can be used for example for page
> > cache when DMA mapping do not use it. On dma_alloc_from_contiguous()
> > request such pages are migrated out of CMA area to free required
> > contiguous block and fulfill the request. This allows to allocate large
> > contiguous chunks of memory at any time assuming that there is enough
> > free memory available in the system.
> >
> > This code is heavily based on earlier works by Michal Nazarewicz.
>
> And how are you addressing the technical concerns about aliasing of
> cache attributes which I keep bringing up with this and you keep
> ignoring and telling me that I'm standing in your way.
I'm perfectly aware of the issues with aliasing of cache attributes.
My idea is to change low memory linear mapping for all CMA areas on boot
time to use 2 level page tables (4KiB mappings instead of super-section
mappings). This way the page properties for a single page in CMA area can
be changed/updated at any time to match required coherent/writecombine
attributes. Linear mapping can be even removed completely if we want to
create the it elsewhere in the address space.
The only problem that might need to be resolved is GFP_ATOMIC allocation
(updating page properties probably requires some locking), but it can be
served from a special area which is created on boot without low-memory
mapping at all. None sane driver will call dma_alloc_coherent(GFP_ATOMIC)
for large buffers anyway.
CMA limits the memory area from which coherent pages are being taken quite
well, so the change in the linear mapping method should have no significant
impact on the system performance.
I didn't implement such solution yet, because it is really hard to handle
all issues at the same time and creating the allocator was just a first
step.
Best regards
--
Marek Szyprowski
Samsung Poland R&D Center
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists