From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753479Ab1FNPt1 (ORCPT ); Tue, 14 Jun 2011 11:49:27 -0400 Received: from wolverine02.qualcomm.com ([199.106.114.251]:36235 "EHLO wolverine02.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751646Ab1FNPtZ (ORCPT ); Tue, 14 Jun 2011 11:49:25 -0400 X-IronPort-AV: E=McAfee;i="5400,1158,6376"; a="97427566" Message-ID: <4DF782F1.9030105@codeaurora.org> Date: Tue, 14 Jun 2011 09:49:05 -0600 From: Jordan Crouse User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110424 Thunderbird/3.1.10 MIME-Version: 1.0 To: Alan Cox CC: Marek Szyprowski , "'Ankita Garg'" , "'Daniel Walker'" , "'Arnd Bergmann'" , "'Johan MOSSBERG'" , "'Jesse Barker'" , "'Mel Gorman'" , linux-kernel@vger.kernel.org, "'Michal Nazarewicz'" , linaro-mm-sig@lists.linaro.org, linux-mm@kvack.org, "'Kyungmin Park'" , "'KAMEZAWA Hiroyuki'" , "'Andrew Morton'" , linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org Subject: Re: [Linaro-mm-sig] [PATCH 02/10] lib: genalloc: Generic allocator improvements References: <1307699698-29369-1-git-send-email-m.szyprowski@samsung.com> <1307699698-29369-3-git-send-email-m.szyprowski@samsung.com> <20110610122451.15af86d1@lxorguk.ukuu.org.uk> <000c01cc2769$02669b70$0733d250$%szyprowski@samsung.com> <20110610135217.701a2fd2@lxorguk.ukuu.org.uk> In-Reply-To: <20110610135217.701a2fd2@lxorguk.ukuu.org.uk> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 06/10/2011 06:52 AM, Alan Cox wrote: >> I plan to replace it with lib/bitmap.c bitmap_* based allocator (similar like >> it it is used by dma_declare_coherent_memory() and friends in >> drivers/base/dma-coherent.c). We need something really simple for CMA area >> management. >> >> IMHO allocate_resource and friends a bit too heavy here, but good to know >> that such allocator also exists. > > Not sure I'd class allocate_resource as heavyweight but providing it's > using something that already exists rather than inventing yet another > allocator. > > This wants dealing with before it goes upstream though so the chaneges in > lib/*c etc never have to reach mainline and then get changed back. Even if CMA doesn't end up using genalloc, there are existing consumers of the API and I think the _aligned function has value. I agree that allocate_resource isn't overly heavy, but comparatively genalloc is really simple and lightweight for a driver to manage a contiguous address space without a lot of extra thought. I think both APIs serve slightly different masters, but if somebody thought about it long enough there could be some consolidation (same goes for the internal guts of dma_declare_coherent_memory). I agree with Michal - if genalloc goes deprecated, then so be it, but as long as it lives, I think its useful to get these functions upstream. Jordan From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail144.messagelabs.com (mail144.messagelabs.com [216.82.254.51]) by kanga.kvack.org (Postfix) with ESMTP id 6E9F26B0082 for ; Tue, 14 Jun 2011 11:49:27 -0400 (EDT) Message-ID: <4DF782F1.9030105@codeaurora.org> Date: Tue, 14 Jun 2011 09:49:05 -0600 From: Jordan Crouse MIME-Version: 1.0 Subject: Re: [Linaro-mm-sig] [PATCH 02/10] lib: genalloc: Generic allocator improvements References: <1307699698-29369-1-git-send-email-m.szyprowski@samsung.com> <1307699698-29369-3-git-send-email-m.szyprowski@samsung.com> <20110610122451.15af86d1@lxorguk.ukuu.org.uk> <000c01cc2769$02669b70$0733d250$%szyprowski@samsung.com> <20110610135217.701a2fd2@lxorguk.ukuu.org.uk> In-Reply-To: <20110610135217.701a2fd2@lxorguk.ukuu.org.uk> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org List-ID: To: Alan Cox Cc: Marek Szyprowski , 'Ankita Garg' , 'Daniel Walker' , 'Arnd Bergmann' , 'Johan MOSSBERG' , 'Jesse Barker' , 'Mel Gorman' , linux-kernel@vger.kernel.org, 'Michal Nazarewicz' , linaro-mm-sig@lists.linaro.org, linux-mm@kvack.org, 'Kyungmin Park' , 'KAMEZAWA Hiroyuki' , 'Andrew Morton' , linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org On 06/10/2011 06:52 AM, Alan Cox wrote: >> I plan to replace it with lib/bitmap.c bitmap_* based allocator (similar like >> it it is used by dma_declare_coherent_memory() and friends in >> drivers/base/dma-coherent.c). We need something really simple for CMA area >> management. >> >> IMHO allocate_resource and friends a bit too heavy here, but good to know >> that such allocator also exists. > > Not sure I'd class allocate_resource as heavyweight but providing it's > using something that already exists rather than inventing yet another > allocator. > > This wants dealing with before it goes upstream though so the chaneges in > lib/*c etc never have to reach mainline and then get changed back. Even if CMA doesn't end up using genalloc, there are existing consumers of the API and I think the _aligned function has value. I agree that allocate_resource isn't overly heavy, but comparatively genalloc is really simple and lightweight for a driver to manage a contiguous address space without a lot of extra thought. I think both APIs serve slightly different masters, but if somebody thought about it long enough there could be some consolidation (same goes for the internal guts of dma_declare_coherent_memory). I agree with Michal - if genalloc goes deprecated, then so be it, but as long as it lives, I think its useful to get these functions upstream. Jordan -- 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: jcrouse@codeaurora.org (Jordan Crouse) Date: Tue, 14 Jun 2011 09:49:05 -0600 Subject: [Linaro-mm-sig] [PATCH 02/10] lib: genalloc: Generic allocator improvements In-Reply-To: <20110610135217.701a2fd2@lxorguk.ukuu.org.uk> References: <1307699698-29369-1-git-send-email-m.szyprowski@samsung.com> <1307699698-29369-3-git-send-email-m.szyprowski@samsung.com> <20110610122451.15af86d1@lxorguk.ukuu.org.uk> <000c01cc2769$02669b70$0733d250$%szyprowski@samsung.com> <20110610135217.701a2fd2@lxorguk.ukuu.org.uk> Message-ID: <4DF782F1.9030105@codeaurora.org> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On 06/10/2011 06:52 AM, Alan Cox wrote: >> I plan to replace it with lib/bitmap.c bitmap_* based allocator (similar like >> it it is used by dma_declare_coherent_memory() and friends in >> drivers/base/dma-coherent.c). We need something really simple for CMA area >> management. >> >> IMHO allocate_resource and friends a bit too heavy here, but good to know >> that such allocator also exists. > > Not sure I'd class allocate_resource as heavyweight but providing it's > using something that already exists rather than inventing yet another > allocator. > > This wants dealing with before it goes upstream though so the chaneges in > lib/*c etc never have to reach mainline and then get changed back. Even if CMA doesn't end up using genalloc, there are existing consumers of the API and I think the _aligned function has value. I agree that allocate_resource isn't overly heavy, but comparatively genalloc is really simple and lightweight for a driver to manage a contiguous address space without a lot of extra thought. I think both APIs serve slightly different masters, but if somebody thought about it long enough there could be some consolidation (same goes for the internal guts of dma_declare_coherent_memory). I agree with Michal - if genalloc goes deprecated, then so be it, but as long as it lives, I think its useful to get these functions upstream. Jordan