Received: by 10.213.65.68 with SMTP id h4csp1000034imn; Wed, 14 Mar 2018 06:46:19 -0700 (PDT) X-Google-Smtp-Source: AG47ELsjsvOhFPhtPJpm7ju/8PHAQFh0BoG1zaAjFrp+s9ew1DY73UIWN01TAL4x13Jxz33x/8TX X-Received: by 10.101.102.21 with SMTP id w21mr3848891pgv.247.1521035179588; Wed, 14 Mar 2018 06:46:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521035179; cv=none; d=google.com; s=arc-20160816; b=F1Si1xTBcHjSmPac7NIvgcF93uqX736kp8h2C8RjQcGRura33+ulKl9JJ/S0BIc92P poJhIECEnNlf2o3sa3m3iOKOzXkSyuvw/3kOGs88qplp4YwmZdgzkAUm95OrbCaCtUmA ubgkwgdQpsdoc9kqMlQqQoiqK0wC4fViX+IKiskiWzdVJQKCMxkV6aF7BoWFUCNEW3mu /c4QQvVvtW7UHIL6BCqu/ZoMG7xH4h44m46ML8qVetovz8B5Tph8RohdTtDiAYh2ZNT6 WlX8D+ac5Hyv2B2kHno0KPSTelVHDLi/EUUssHiGFxM49pUSeYhBdMPz2mpUDPB1SusR Tovw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=fExZklkEoVcmZvZgVefFGf9w/rpVghSfwHQEq5UrJT0=; b=GNLw9vIdeeWsNLvD39LvvpqEF7ODznzVZUbk285dU4OPpi+GkVbG94VjeBsIz8n1Hg gWjiDwyxuI0f8bhC0wf/4v46ewS9lOENO7+ognK9ra1KKR5Wx5Bie7VLL1Mc+9941afj Wu5LaETGLpU4BzjilPPld/gkC89qNLm6A+me9ciwJQHvnpw3BKMHpDMpJnCBd9WbqmNb q4wl+tCSXtnDtbD17MRio/Ezg3/WIP7NkqO44C711tgW7EqpO+8HadAr3+PmS0ip3ysZ /5uG9Dqwodqf1PS6FCZtFXEvMU+ZQuxokaq4Br1lEzfYhfzRCQiNK1osWRfXh+ijiJn8 n4QA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=k0AHqD53; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o2si2124437pfg.286.2018.03.14.06.46.02; Wed, 14 Mar 2018 06:46:19 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=k0AHqD53; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751615AbeCNNpF (ORCPT + 99 others); Wed, 14 Mar 2018 09:45:05 -0400 Received: from mail-wm0-f67.google.com ([74.125.82.67]:35178 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751527AbeCNNpC (ORCPT ); Wed, 14 Mar 2018 09:45:02 -0400 Received: by mail-wm0-f67.google.com with SMTP id x7so4143054wmc.0 for ; Wed, 14 Mar 2018 06:45:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=fExZklkEoVcmZvZgVefFGf9w/rpVghSfwHQEq5UrJT0=; b=k0AHqD53u0cEK3SySSh/Y+HTZZno1HGLLYCDVGLMiRaJ3IXdCjevvn6gQdqwoh3m2Q SxbScE+R/KQZnt03BYvDVIJvaF/J2cCygf5Ca2av8n+AdRLgRU5XogMSZwTryqCNfSWB bYXQNyeAPE3D/Ziv6nzTlnUAh3SUhTih93RDA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=fExZklkEoVcmZvZgVefFGf9w/rpVghSfwHQEq5UrJT0=; b=V5ihUiaouMZ38WnmXZqopzIOL9mZKYgmgwg5g7xSXDQ/PEpHI71+0ftVjqE7w4XOdQ rGN0s86bROi0y/eFiv3nr14J478DbdOIXQxAUVIw4jOjX0tlUkgC3ptp32ae3a277L11 uUWMiRJqK6UATEJKuM09YKvRzaiyvi0jeUA5c6JcxxvTQGEIhQc5lpLeEMctnq9bzQ5T uvJtu/vymTaP2OvYAjgKYVRGRO6HQIR/QR2xwQSGCkLIhpwAcWPd+XXC9tU+IsDOeSry atJCGtPjLcSEE5x9Mt/XugbvqZAd+fmVRq4dWojNaWxvcClEd/Ex3c2ByKH6M4a1k6aa EPrA== X-Gm-Message-State: AElRT7F8oK+0ofI9eIfF6N+fokfmsaVZWUWgvfMWYRzCPLFTeTBEisxw HspW/Bfo9AdkX9d/oaqg1HnIgQ== X-Received: by 10.28.218.1 with SMTP id r1mr1661305wmg.156.1521035100714; Wed, 14 Mar 2018 06:45:00 -0700 (PDT) Received: from localhost.localdomain ([105.148.128.186]) by smtp.gmail.com with ESMTPSA id q9sm3041064wrf.11.2018.03.14.06.44.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 14 Mar 2018 06:44:59 -0700 (PDT) From: Ard Biesheuvel To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: mark.rutland@arm.com, will.deacon@arm.com, catalin.marinas@arm.com, marc.zyngier@arm.com, Ard Biesheuvel , Daniel Vacek , Mel Gorman , Michal Hocko , Paul Burton , Pavel Tatashin , Vlastimil Babka , Andrew Morton , Linus Torvalds Subject: [PATCH] Revert "mm/page_alloc: fix memmap_init_zone pageblock alignment" Date: Wed, 14 Mar 2018 13:44:31 +0000 Message-Id: <20180314134431.13241-1-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.15.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This reverts commit 864b75f9d6b0100bb24fdd9a20d156e7cda9b5ae. It breaks the boot on my Socionext SynQuacer based system, because it enters an infinite loop iterating over the pfns. Adding the following debug output to memmap_init_zone() --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -5365,6 +5365,11 @@ * the valid region but still depends on correct page * metadata. */ + pr_err("pfn:%lx oldnext:%lx newnext:%lx\n", pfn, + memblock_next_valid_pfn(pfn, end_pfn) - 1, + (memblock_next_valid_pfn(pfn, end_pfn) & + ~(pageblock_nr_pages-1)) - 1); + pfn = (memblock_next_valid_pfn(pfn, end_pfn) & ~(pageblock_nr_pages-1)) - 1; #endif results in Booting Linux on physical CPU 0x0000000000 [0x410fd034] Linux version 4.16.0-rc5-00004-gfc6eabbbf8ef-dirty (ard@dogfood) ... Machine model: Socionext Developer Box earlycon: pl11 at MMIO 0x000000002a400000 (options '') bootconsole [pl11] enabled efi: Getting EFI parameters from FDT: efi: EFI v2.70 by Linaro efi: SMBIOS 3.0=0xff580000 ESRT=0xf9948198 MEMATTR=0xf83b1a98 RNG=0xff7ac898 random: fast init done efi: seeding entropy pool esrt: Reserving ESRT space from 0x00000000f9948198 to 0x00000000f99481d0. cma: Reserved 16 MiB at 0x00000000fd800000 NUMA: No NUMA configuration found NUMA: Faking a node at [mem 0x0000000000000000-0x0000000fffffffff] NUMA: NODE_DATA [mem 0xffffd8d80-0xffffda87f] Zone ranges: DMA32 [mem 0x0000000080000000-0x00000000ffffffff] Normal [mem 0x0000000100000000-0x0000000fffffffff] Movable zone start for each node Early memory node ranges node 0: [mem 0x0000000080000000-0x00000000febeffff] node 0: [mem 0x00000000febf0000-0x00000000fefcffff] node 0: [mem 0x00000000fefd0000-0x00000000ff43ffff] node 0: [mem 0x00000000ff440000-0x00000000ff7affff] node 0: [mem 0x00000000ff7b0000-0x00000000ffffffff] node 0: [mem 0x0000000880000000-0x0000000fffffffff] Initmem setup node 0 [mem 0x0000000080000000-0x0000000fffffffff] pfn:febf0 oldnext:febf0 newnext:fe9ff pfn:febf0 oldnext:febf0 newnext:fe9ff pfn:febf0 oldnext:febf0 newnext:fe9ff etc etc and the boot never proceeds after this point. So the logic is obviously flawed, and so it is best to revert this at the current -rc stage (unless someone can fix the logic instead) Fixes: 864b75f9d6b0 ("mm/page_alloc: fix memmap_init_zone pageblock alignment") Cc: Daniel Vacek Cc: Mel Gorman Cc: Michal Hocko Cc: Paul Burton Cc: Pavel Tatashin Cc: Vlastimil Babka Cc: Andrew Morton Cc: Linus Torvalds Signed-off-by: Ard Biesheuvel --- mm/page_alloc.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 3d974cb2a1a1..cb416723538f 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -5359,14 +5359,9 @@ void __meminit memmap_init_zone(unsigned long size, int nid, unsigned long zone, /* * Skip to the pfn preceding the next valid one (or * end_pfn), such that we hit a valid pfn (or end_pfn) - * on our next iteration of the loop. Note that it needs - * to be pageblock aligned even when the region itself - * is not. move_freepages_block() can shift ahead of - * the valid region but still depends on correct page - * metadata. + * on our next iteration of the loop. */ - pfn = (memblock_next_valid_pfn(pfn, end_pfn) & - ~(pageblock_nr_pages-1)) - 1; + pfn = memblock_next_valid_pfn(pfn, end_pfn) - 1; #endif continue; } -- 2.15.1