From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752402AbdBMMYz (ORCPT ); Mon, 13 Feb 2017 07:24:55 -0500 Received: from pandora.armlinux.org.uk ([78.32.30.218]:45316 "EHLO pandora.armlinux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750853AbdBMMYy (ORCPT ); Mon, 13 Feb 2017 07:24:54 -0500 Date: Mon, 13 Feb 2017 12:24:07 +0000 From: Russell King - ARM Linux To: Will Deacon Cc: zhouxianrong@huawei.com, mark.rutland@arm.com, wangkefeng.wang@huawei.com, srikar@linux.vnet.ibm.com, Mi.Sophia.Wang@huawei.com, catalin.marinas@arm.com, linux-mm@kvack.org, zhangshiming5@huawei.com, frowand.list@gmail.com, zijun_hu@htc.com, jszhang@marvell.com, won.ho.park@huawei.com, kuleshovmail@gmail.com, devicetree@vger.kernel.org, chengang@emindsoft.com.cn, zhouxiyu@huawei.com, tj@kernel.org, robh+dt@kernel.org, weidu.du@huawei.com, linux-arm-kernel@lists.infradead.org, ard.biesheuvel@linaro.org, steve.capper@arm.com, linux-kernel@vger.kernel.org, joe@perches.com, dennis.chen@arm.com, akpm@linux-foundation.org, gkulkarni@caviumnetworks.com Subject: Re: [PATCH] mm: free reserved area's memmap if possiable Message-ID: <20170213122407.GX27312@n2100.armlinux.org.uk> References: <1486987349-58711-1-git-send-email-zhouxianrong@huawei.com> <20170213121659.GM1512@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170213121659.GM1512@arm.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Feb 13, 2017 at 12:17:00PM +0000, Will Deacon wrote: > Adding linux-arm-kernel and devicetree (look for "raw-pfn"), since this > impacts directly on those. > > On Mon, Feb 13, 2017 at 08:02:29PM +0800, zhouxianrong@huawei.com wrote: > > From: zhouxianrong > > > > just like freeing no-map area's memmap we could free reserved > > area's memmap as well only when user of reserved area indicate > > that we can do this in dts or drivers. that is, user of reserved > > area know how to use the reserved area who could not memblock_free > > or free_reserved_xxx the reserved area and regard the area as raw > > pfn usage. the patch supply a way to users who want to utilize the > > memmap memory corresponding to raw pfn reserved areas as many as > > possible. > > I don't really understand this. Can you point me at a specific use-case, > please? Is CMA involved here? You don't need "dt permission" to free the memmap page array for the regions between memory areas. In fact, adding a DT property for that goes against the "DT describes the hardware not the implementation" requirement, since the memmap page array is a Linux implementation detail. 32-bit ARM has been freeing the memmap page array between memory areas for years since pre-DT days, and continues to do so. See free_unused_memmap(). -- RMK's Patch system: http://www.armlinux.org.uk/developer/patches/ FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up according to speedtest.net. From mboxrd@z Thu Jan 1 00:00:00 1970 From: Russell King - ARM Linux Subject: Re: [PATCH] mm: free reserved area's memmap if possiable Date: Mon, 13 Feb 2017 12:24:07 +0000 Message-ID: <20170213122407.GX27312@n2100.armlinux.org.uk> References: <1486987349-58711-1-git-send-email-zhouxianrong@huawei.com> <20170213121659.GM1512@arm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <20170213121659.GM1512@arm.com> Sender: owner-linux-mm@kvack.org To: Will Deacon Cc: zhouxianrong@huawei.com, mark.rutland@arm.com, wangkefeng.wang@huawei.com, srikar@linux.vnet.ibm.com, Mi.Sophia.Wang@huawei.com, catalin.marinas@arm.com, linux-mm@kvack.org, zhangshiming5@huawei.com, frowand.list@gmail.com, zijun_hu@htc.com, jszhang@marvell.com, won.ho.park@huawei.com, kuleshovmail@gmail.com, devicetree@vger.kernel.org, chengang@emindsoft.com.cn, zhouxiyu@huawei.com, tj@kernel.org, robh+dt@kernel.org, weidu.du@huawei.com, linux-arm-kernel@lists.infradead.org, ard.biesheuvel@linaro.org, steve.capper@arm.com, linux-kernel@vger.kernel.org, joe@perches.com, dennis.chen@arm.com, akpm@linux-foundation.org, gkulkarni@caviumnetworks.com List-Id: devicetree@vger.kernel.org On Mon, Feb 13, 2017 at 12:17:00PM +0000, Will Deacon wrote: > Adding linux-arm-kernel and devicetree (look for "raw-pfn"), since this > impacts directly on those. > > On Mon, Feb 13, 2017 at 08:02:29PM +0800, zhouxianrong@huawei.com wrote: > > From: zhouxianrong > > > > just like freeing no-map area's memmap we could free reserved > > area's memmap as well only when user of reserved area indicate > > that we can do this in dts or drivers. that is, user of reserved > > area know how to use the reserved area who could not memblock_free > > or free_reserved_xxx the reserved area and regard the area as raw > > pfn usage. the patch supply a way to users who want to utilize the > > memmap memory corresponding to raw pfn reserved areas as many as > > possible. > > I don't really understand this. Can you point me at a specific use-case, > please? Is CMA involved here? You don't need "dt permission" to free the memmap page array for the regions between memory areas. In fact, adding a DT property for that goes against the "DT describes the hardware not the implementation" requirement, since the memmap page array is a Linux implementation detail. 32-bit ARM has been freeing the memmap page array between memory areas for years since pre-DT days, and continues to do so. See free_unused_memmap(). -- RMK's Patch system: http://www.armlinux.org.uk/developer/patches/ FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up according to speedtest.net. -- 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: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 From: linux@armlinux.org.uk (Russell King - ARM Linux) Date: Mon, 13 Feb 2017 12:24:07 +0000 Subject: [PATCH] mm: free reserved area's memmap if possiable In-Reply-To: <20170213121659.GM1512@arm.com> References: <1486987349-58711-1-git-send-email-zhouxianrong@huawei.com> <20170213121659.GM1512@arm.com> Message-ID: <20170213122407.GX27312@n2100.armlinux.org.uk> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On Mon, Feb 13, 2017 at 12:17:00PM +0000, Will Deacon wrote: > Adding linux-arm-kernel and devicetree (look for "raw-pfn"), since this > impacts directly on those. > > On Mon, Feb 13, 2017 at 08:02:29PM +0800, zhouxianrong at huawei.com wrote: > > From: zhouxianrong > > > > just like freeing no-map area's memmap we could free reserved > > area's memmap as well only when user of reserved area indicate > > that we can do this in dts or drivers. that is, user of reserved > > area know how to use the reserved area who could not memblock_free > > or free_reserved_xxx the reserved area and regard the area as raw > > pfn usage. the patch supply a way to users who want to utilize the > > memmap memory corresponding to raw pfn reserved areas as many as > > possible. > > I don't really understand this. Can you point me at a specific use-case, > please? Is CMA involved here? You don't need "dt permission" to free the memmap page array for the regions between memory areas. In fact, adding a DT property for that goes against the "DT describes the hardware not the implementation" requirement, since the memmap page array is a Linux implementation detail. 32-bit ARM has been freeing the memmap page array between memory areas for years since pre-DT days, and continues to do so. See free_unused_memmap(). -- RMK's Patch system: http://www.armlinux.org.uk/developer/patches/ FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up according to speedtest.net.