From patchwork Mon Mar 25 04:11:13 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joonsoo Kim X-Patchwork-Id: 2328871 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id 07DC93FC54 for ; Mon, 25 Mar 2013 04:14:50 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UJylo-0006B4-SE; Mon, 25 Mar 2013 04:12:28 +0000 Received: from lgemrelse7q.lge.com ([156.147.1.151]) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UJyk7-0005hO-C7 for linux-arm-kernel@lists.infradead.org; Mon, 25 Mar 2013 04:10:45 +0000 X-AuditID: 9c930197-b7c9dae000006959-74-514fce3bc8a7 Received: from js1304-P5Q-DELUXE.LGE.NET ( [10.177.220.249]) by LGEMRELSE7Q.lge.com (Symantec Brightmail Gateway) with SMTP id 66.9C.26969.B3ECF415; Mon, 25 Mar 2013 13:10:35 +0900 (KST) From: Joonsoo Kim To: Russell King Subject: [RFC PATCH 5/6] ARM, mm: change meaning of max_low_pfn to maximum pfn for nobootmem Date: Mon, 25 Mar 2013 13:11:13 +0900 Message-Id: <1364184674-13798-6-git-send-email-iamjoonsoo.kim@lge.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1364184674-13798-1-git-send-email-iamjoonsoo.kim@lge.com> References: <1364184674-13798-1-git-send-email-iamjoonsoo.kim@lge.com> X-Brightmail-Tracker: AAAAAA== X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130325_001043_765893_2483B917 X-CRM114-Status: GOOD ( 13.22 ) X-Spam-Score: -5.5 (-----) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-5.5 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at http://www.dnswl.org/, medium trust [156.147.1.151 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -1.3 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Joonsoo Kim , Will Deacon , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Nicolas Pitre X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org nobootmem use max_low_pfn for computing boundary in free_all_bootmem() So we need proper value to max_low_pfn. But, there is some difficulty related to max_low_pfn. max_low_pfn is used for two meanings in various architectures. One is for number of pages in lowmem and the other is for maximum lowmem pfn. Now, in ARM, it is used as number of pages in lowmem. You can get more information in below link. http://lwn.net/Articles/543408/ http://lwn.net/Articles/543424/ As I investigated, architectures which use max_low_pfn as maximum pfn are more than others, so to change meaning of max_low_pfn to maximum pfn is preferable solution to me. This patch change max_low_pfn as maximum lowmem pfn in ARM. In addition, min_low_pfn, max_pfn is assigned according to this criteria. There is no real user for max_low_pfn except block/blk-setting.c and blk-setting.c assume that max_low_pfn is maximum lowmem pfn, so this patch may not harm anything. Signed-off-by: Joonsoo Kim diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c index 049414a..873f4ca 100644 --- a/arch/arm/mm/init.c +++ b/arch/arm/mm/init.c @@ -423,12 +423,10 @@ void __init bootmem_init(void) * This doesn't seem to be used by the Linux memory manager any * more, but is used by ll_rw_block. If we can get rid of it, we * also get rid of some of the stuff above as well. - * - * Note: max_low_pfn and max_pfn reflect the number of _pages_ in - * the system, not the maximum PFN. */ - max_low_pfn = max_low - PHYS_PFN_OFFSET; - max_pfn = max_high - PHYS_PFN_OFFSET; + min_low_pfn = min; + max_low_pfn = max_low; + max_pfn = max_high; } static inline int free_area(unsigned long pfn, unsigned long end, char *s) @@ -544,7 +542,7 @@ static void __init free_unused_memmap(struct meminfo *mi) static void __init free_highpages(void) { #ifdef CONFIG_HIGHMEM - unsigned long max_low = max_low_pfn + PHYS_PFN_OFFSET; + unsigned long max_low = max_low_pfn; struct memblock_region *mem, *res; /* set highmem page free */