From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755156Ab1GEKZk (ORCPT ); Tue, 5 Jul 2011 06:25:40 -0400 Received: from mailout4.w1.samsung.com ([210.118.77.14]:64980 "EHLO mailout4.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750812Ab1GEKZi (ORCPT ); Tue, 5 Jul 2011 06:25:38 -0400 MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; charset=us-ascii Date: Tue, 05 Jul 2011 12:24:58 +0200 From: Marek Szyprowski Subject: RE: [PATCH 6/8] drivers: add Contiguous Memory Allocator In-reply-to: <1309851710-3828-7-git-send-email-m.szyprowski@samsung.com> To: Marek Szyprowski , 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 Cc: "'Michal Nazarewicz'" , "'Kyungmin Park'" , "'Andrew Morton'" , "'KAMEZAWA Hiroyuki'" , "'Ankita Garg'" , "'Daniel Walker'" , "'Mel Gorman'" , "'Arnd Bergmann'" , "'Jesse Barker'" , "'Jonathan Corbet'" , "'Chunsang Jeong'" Message-id: <000101cc3afd$cac46ff0$604d4fd0$%szyprowski@samsung.com> Organization: SPRC X-Mailer: Microsoft Office Outlook 12.0 Content-language: pl Thread-index: Acw65wJ1jp7zAY37SWW2gb29m2bk+AAFgkUg References: <1309851710-3828-1-git-send-email-m.szyprowski@samsung.com> <1309851710-3828-7-git-send-email-m.szyprowski@samsung.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, On Tuesday, July 05, 2011 9:42 AM 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. > > Signed-off-by: Marek Szyprowski > Signed-off-by: Kyungmin Park > CC: Michal Nazarewicz > --- > drivers/base/Kconfig | 77 +++++++++ > drivers/base/Makefile | 1 + > drivers/base/dma-contiguous.c | 367 > ++++++++++++++++++++++++++++++++++++++++ > include/linux/dma-contiguous.h | 104 +++++++++++ > 4 files changed, 549 insertions(+), 0 deletions(-) > create mode 100644 drivers/base/dma-contiguous.c > create mode 100644 include/linux/dma-contiguous.h > > diff --git a/drivers/base/Kconfig b/drivers/base/Kconfig > index d57e8d0..95ae1a7 100644 > --- a/drivers/base/Kconfig > +++ b/drivers/base/Kconfig > @@ -168,4 +168,81 @@ config SYS_HYPERVISOR > bool > default n > > +config CMA > + bool "Contiguous Memory Allocator" > + depends HAVE_DMA_CONTIGUOUS && HAVE_MEMBLOCK The above line should be obviously "depends on HAVE_DMA_CONTIGUOUS && HAVE_MEMBLOCK". I'm sorry for posting broken version. (snipped) Best regards -- Marek Szyprowski Samsung Poland R&D Center From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail137.messagelabs.com (mail137.messagelabs.com [216.82.249.19]) by kanga.kvack.org (Postfix) with SMTP id 3D2FC900122 for ; Tue, 5 Jul 2011 06:25:36 -0400 (EDT) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; charset=us-ascii Received: from eu_spt1 ([210.118.77.13]) by mailout3.w1.samsung.com (Sun Java(tm) System Messaging Server 6.3-8.04 (built Jul 29 2009; 32bit)) with ESMTP id <0LNU009MFVMJ9W00@mailout3.w1.samsung.com> for linux-mm@kvack.org; Tue, 05 Jul 2011 11:25:31 +0100 (BST) Received: from linux.samsung.com ([106.116.38.10]) by spt1.w1.samsung.com (iPlanet Messaging Server 5.2 Patch 2 (built Jul 14 2004)) with ESMTPA id <0LNU00GI8VMHEB@spt1.w1.samsung.com> for linux-mm@kvack.org; Tue, 05 Jul 2011 11:25:30 +0100 (BST) Date: Tue, 05 Jul 2011 12:24:58 +0200 From: Marek Szyprowski Subject: RE: [PATCH 6/8] drivers: add Contiguous Memory Allocator In-reply-to: <1309851710-3828-7-git-send-email-m.szyprowski@samsung.com> Message-id: <000101cc3afd$cac46ff0$604d4fd0$%szyprowski@samsung.com> Content-language: pl References: <1309851710-3828-1-git-send-email-m.szyprowski@samsung.com> <1309851710-3828-7-git-send-email-m.szyprowski@samsung.com> Sender: owner-linux-mm@kvack.org List-ID: To: Marek Szyprowski , 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 Cc: 'Michal Nazarewicz' , 'Kyungmin Park' , 'Andrew Morton' , 'KAMEZAWA Hiroyuki' , 'Ankita Garg' , 'Daniel Walker' , 'Mel Gorman' , 'Arnd Bergmann' , 'Jesse Barker' , 'Jonathan Corbet' , 'Chunsang Jeong' Hello, On Tuesday, July 05, 2011 9:42 AM 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. > > Signed-off-by: Marek Szyprowski > Signed-off-by: Kyungmin Park > CC: Michal Nazarewicz > --- > drivers/base/Kconfig | 77 +++++++++ > drivers/base/Makefile | 1 + > drivers/base/dma-contiguous.c | 367 > ++++++++++++++++++++++++++++++++++++++++ > include/linux/dma-contiguous.h | 104 +++++++++++ > 4 files changed, 549 insertions(+), 0 deletions(-) > create mode 100644 drivers/base/dma-contiguous.c > create mode 100644 include/linux/dma-contiguous.h > > diff --git a/drivers/base/Kconfig b/drivers/base/Kconfig > index d57e8d0..95ae1a7 100644 > --- a/drivers/base/Kconfig > +++ b/drivers/base/Kconfig > @@ -168,4 +168,81 @@ config SYS_HYPERVISOR > bool > default n > > +config CMA > + bool "Contiguous Memory Allocator" > + depends HAVE_DMA_CONTIGUOUS && HAVE_MEMBLOCK The above line should be obviously "depends on HAVE_DMA_CONTIGUOUS && HAVE_MEMBLOCK". I'm sorry for posting broken version. (snipped) Best regards -- Marek Szyprowski Samsung Poland R&D Center -- 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: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 From: m.szyprowski@samsung.com (Marek Szyprowski) Date: Tue, 05 Jul 2011 12:24:58 +0200 Subject: [PATCH 6/8] drivers: add Contiguous Memory Allocator In-Reply-To: <1309851710-3828-7-git-send-email-m.szyprowski@samsung.com> References: <1309851710-3828-1-git-send-email-m.szyprowski@samsung.com> <1309851710-3828-7-git-send-email-m.szyprowski@samsung.com> Message-ID: <000101cc3afd$cac46ff0$604d4fd0$%szyprowski@samsung.com> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org Hello, On Tuesday, July 05, 2011 9:42 AM 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. > > Signed-off-by: Marek Szyprowski > Signed-off-by: Kyungmin Park > CC: Michal Nazarewicz > --- > drivers/base/Kconfig | 77 +++++++++ > drivers/base/Makefile | 1 + > drivers/base/dma-contiguous.c | 367 > ++++++++++++++++++++++++++++++++++++++++ > include/linux/dma-contiguous.h | 104 +++++++++++ > 4 files changed, 549 insertions(+), 0 deletions(-) > create mode 100644 drivers/base/dma-contiguous.c > create mode 100644 include/linux/dma-contiguous.h > > diff --git a/drivers/base/Kconfig b/drivers/base/Kconfig > index d57e8d0..95ae1a7 100644 > --- a/drivers/base/Kconfig > +++ b/drivers/base/Kconfig > @@ -168,4 +168,81 @@ config SYS_HYPERVISOR > bool > default n > > +config CMA > + bool "Contiguous Memory Allocator" > + depends HAVE_DMA_CONTIGUOUS && HAVE_MEMBLOCK The above line should be obviously "depends on HAVE_DMA_CONTIGUOUS && HAVE_MEMBLOCK". I'm sorry for posting broken version. (snipped) Best regards -- Marek Szyprowski Samsung Poland R&D Center