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: 7586731 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id D4E369F1C2 for ; Mon, 9 Nov 2015 23:23:04 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E6197205EC for ; Mon, 9 Nov 2015 23:23:03 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1DED2205E9 for ; Mon, 9 Nov 2015 23:23:03 +0000 (UTC) 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-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP > @@ -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);