From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from psmtp.com (na3sys010amx197.postini.com [74.125.245.197]) by kanga.kvack.org (Postfix) with SMTP id 29BEF6B0002 for ; Wed, 20 Feb 2013 00:31:40 -0500 (EST) Received: by mail-pa0-f47.google.com with SMTP id bj3so3860272pad.34 for ; Tue, 19 Feb 2013 21:31:39 -0800 (PST) Message-ID: <51245FB4.6050506@gmail.com> Date: Wed, 20 Feb 2013 13:31:32 +0800 From: Simon Jeons MIME-Version: 1.0 Subject: Re: [PATCH] mm: cma: fix accounting of CMA pages placed in high memory References: <1359973626-3900-1-git-send-email-m.szyprowski@samsung.com> <20130204233430.GA2610@blaptop> <5110B05B.5070109@samsung.com> <51237DDB.2050305@gmail.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org List-ID: To: Kyungmin Park Cc: Marek Szyprowski , Minchan Kim , linux-mm@kvack.org, linux-kernel@vger.kernel.org, akpm@linux-foundation.org, mgorman@suse.de On 02/20/2013 10:57 AM, Kyungmin Park wrote: > On Tue, Feb 19, 2013 at 10:27 PM, Simon Jeons wrote: >> On 02/05/2013 03:10 PM, Marek Szyprowski wrote: >>> Hello, >>> >>> On 2/5/2013 12:34 AM, Minchan Kim wrote: >>>> On Mon, Feb 04, 2013 at 11:27:05AM +0100, Marek Szyprowski wrote: >>>>> The total number of low memory pages is determined as >>>>> totalram_pages - totalhigh_pages, so without this patch all CMA >>>>> pageblocks placed in highmem were accounted to low memory. >>>> So what's the end user effect? With the effect, we have to decide >>>> routing it on stable. >>>> >>>>> Signed-off-by: Marek Szyprowski >>>>> --- >>>>> mm/page_alloc.c | 4 ++++ >>>>> 1 file changed, 4 insertions(+) >>>>> >>>>> diff --git a/mm/page_alloc.c b/mm/page_alloc.c >>>>> index f5bab0a..6415d93 100644 >>>>> --- a/mm/page_alloc.c >>>>> +++ b/mm/page_alloc.c >>>>> @@ -773,6 +773,10 @@ void __init init_cma_reserved_pageblock(struct >>>>> page *page) >>>>> set_pageblock_migratetype(page, MIGRATE_CMA); >>>>> __free_pages(page, pageblock_order); >>>>> totalram_pages += pageblock_nr_pages; >>>>> +#ifdef CONFIG_HIGHMEM >>>> We don't need #ifdef/#endif. >>> >>> #ifdef is required to let this code compile when highmem is not enabled, >>> becuase totalhigh_pages is defined as 0, see include/linux/highmem.h >>> >> Hi Marek, >> >> 1) Why can support CMA regions placed in highmem? > Some vendors use reserved memory at highmem, and it's hard to modify > to use lowmem, so just CMA can support highmem and no need to adjust > address used at reserved memory. >> CMA is for dma buffer, correct? Then how can old dma device access highmem? > What's the "old dma device"? To support it, we also modify I mean dma devices which should still use bounce buffer, then these devices will use bounce buffer to access CMA region in highmem or ...? > arch/arm/mm/dma-mapping.c for handling highmem address. > >> 2) Why there is no totalhigh_pages variable define in the case of config >> highmem? > I don't know. it's just defined in case of highmem. that's reason to > use #ifdef/endif. we don't know hisotrical reason. > > Thank you, > Kyungmin Park >> >>>>> + if (PageHighMem(page)) >>>>> + totalhigh_pages += pageblock_nr_pages; >>>>> +#endif >>>>> } >>>>> #endif >>>>> >>> >>> Best regards >> >> -- >> 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 -- 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