From patchwork Mon Nov 9 23:20:58 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tony Luck X-Patchwork-Id: 542048 Return-Path: X-Original-To: incoming-imx@patchwork.ozlabs.org Delivered-To: patchwork-incoming-imx@bilbo.ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2001:1868:205::9]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3C998140D9D for ; Tue, 10 Nov 2015 10:23:12 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=Vi2IkOVx; dkim-atps=neutral Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZvvkZ-00020V-Nu; Mon, 09 Nov 2015 23:21:23 +0000 Received: from mail-wm0-x22b.google.com ([2a00:1450:400c:c09::22b]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZvvkX-0001yZ-3J for linux-arm-kernel@lists.infradead.org; Mon, 09 Nov 2015 23:21:21 +0000 Received: by wmnn186 with SMTP id n186so131226055wmn.1 for ; Mon, 09 Nov 2015 15:20:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=FiZ9hDcFKSLeHEdXSGpcC5uVgUktXyNS+FtRhoYOyAc=; b=Vi2IkOVxDJLb/ZXxLZKoe/5bpKQDAJ53CUgB2v994oFJxxDhT46rE2wQfbIeMN+EoT cSDXv4olp+JxG/FjA6V156dPxc8Daa99WlLnq5VCIEkQrlMsY3ojfmg8EvPK4Cpy11PV yt4FlkG++W+ZRW5bnIoIYF8rIbWnmWLM1b4h79bL9/Y+Dca3QezOSUwGbFm/t+HAYyB3 Yy3vTrdt3/YreEvTpS9CKj2B2FuhNnhnxdYcnZZ8jZZhj2GpSMRIldjyxfCOEex1LgBM h++EbY2AQcKJe0HnbvLCtGkHH+816AgL3kv19jDeW/JVL8txNFN1eoeADQr6cSv11YMY ESsg== MIME-Version: 1.0 X-Received: by 10.28.14.140 with SMTP id 134mr994440wmo.44.1447111258262; Mon, 09 Nov 2015 15:20:58 -0800 (PST) Received: by 10.194.153.135 with HTTP; Mon, 9 Nov 2015 15:20:58 -0800 (PST) In-Reply-To: <1444253335-5811-1-git-send-email-labbott@fedoraproject.org> References: <1444253335-5811-1-git-send-email-labbott@fedoraproject.org> Date: Mon, 9 Nov 2015 15:20:58 -0800 Message-ID: Subject: Re: [PATCHv4] mm: Don't offset memmap for flatmem From: Tony Luck To: Laura Abbott X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151109_152121_300639_E32E002A X-CRM114-Status: GOOD ( 14.71 ) X-Spam-Score: -2.0 (--) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-2.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [2a00:1450:400c:c09:0:0:0:22b listed in] [list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (tony.luck[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "linux-arm-kernel@lists.infradead.org" , Kevin Hilman , Laura Abbott , Arnd Bergman , Andy Gross , Stephen Boyd , Linux Kernel Mailing List , Steven Rostedt , "linux-mm@kvack.org" , Srinivas Kandagatla , Vlastimil Babka , Bjorn Andersson , Santosh Shilimkar , Laura Abbott , Andrew Morton , Russell King , Mel Gorman Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org List-Id: linux-imx-kernel.lists.patchwork.ozlabs.org > @@ -4984,9 +4987,9 @@ static void __init_refok alloc_node_mem_map(struct pglist_data *pgdat) > */ > if (pgdat == NODE_DATA(0)) { > mem_map = NODE_DATA(0)->node_mem_map; > -#ifdef CONFIG_HAVE_MEMBLOCK_NODE_MAP > +#if defined(CONFIG_HAVE_MEMBLOCK_NODE_MAP) || defined(CONFIG_FLATMEM) > if (page_to_pfn(mem_map) != pgdat->node_start_pfn) > - mem_map -= (pgdat->node_start_pfn - ARCH_PFN_OFFSET); > + mem_map -= offset; > #endif /* CONFIG_HAVE_MEMBLOCK_NODE_MAP */ > } > #endif This piece breaks ia64. See the comment earlier in the function that "ia64 gets its own node_mem_map" ... so we skip the initialization of offset ... and arrive down here and just subtract "0" from mem_map. Attached patch fixes ia64 ... does ARM still work if this is applied? -Tony Tested-by: Laura Abbott diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 208e4c7e771b..c4705095a516 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -5266,6 +5266,7 @@ static void __paginginit free_area_init_core(struct pglist_data *pgdat) static void __init_refok alloc_node_mem_map(struct pglist_data *pgdat) { + unsigned long __maybe_unused start = 0; unsigned long __maybe_unused offset = 0; /* Skip empty nodes */ @@ -5273,9 +5274,11 @@ static void __init_refok alloc_node_mem_map(struct pglist_data *pgdat) return; #ifdef CONFIG_FLAT_NODE_MEM_MAP + start = pgdat->node_start_pfn & ~(MAX_ORDER_NR_PAGES - 1); + offset = pgdat->node_start_pfn - start; /* ia64 gets its own node_mem_map, before this, without bootmem */ if (!pgdat->node_mem_map) { - unsigned long size, start, end; + unsigned long size, end; struct page *map; /* @@ -5284,7 +5287,6 @@ static void __init_refok alloc_node_mem_map(struct pglist_data *pgdat) * for the buddy allocator to function correctly. */ start = pgdat->node_start_pfn & ~(MAX_ORDER_NR_PAGES - 1); - offset = pgdat->node_start_pfn - start; end = pgdat_end_pfn(pgdat); end = ALIGN(end, MAX_ORDER_NR_PAGES); size = (end - start) * sizeof(struct page);