Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp1400590imm; Tue, 2 Oct 2018 07:39:10 -0700 (PDT) X-Google-Smtp-Source: ACcGV60/5pfU21r/zYlrPNzloyOb08JJ6Z+qrRe47Us2FUodmOvi4tyIa0s6rkLSAhkDKjOcmupO X-Received: by 2002:a63:cf4c:: with SMTP id b12-v6mr14851147pgj.418.1538491150548; Tue, 02 Oct 2018 07:39:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538491150; cv=none; d=google.com; s=arc-20160816; b=oPsLF8vi7SaXWWpVWJehjf1JJaFW2iOUA8A/zZutsgC4H93XqSY8lxyQETGuqR45Kd Vu//GBS3iE0OOctjqgfU76+QPeQBAxxX4Bei1XIwoNDS8Im3KtngGDIcumanzXBAa07O VKHZ570uzaas0HpSQjix/sCKgoDvgOBhHSmmuTnoT+dAzTquIZRa5ch27SEcT2KtLGwB VP78RAUrilwcRt+xDkXrqEfyX8v12d2CHFY5JZ/Xvmmf+wxGX4zsL+Ird4aVYLbgbs2o 0odpxlyfdoHjZm8QHnEf5LKEYXS7b5V0+Y/7jSUp9ZVuavPC4nTikn8OY8/DwC1lZ6ps qYKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=UsjZUHavM6O3QeH6tlq9dIQpwA6ici9MyEp6E87EPfo=; b=FRNC0hY6DPlbufLNpoAmJ31gHK5PW97nIYnp91nr/M81d3VYqQrCbVrviCKdOcagw2 V8SI1zMFBaQPOVppAWQ6xZmxfobJUIWn/qF1/5kMbzySfVLwO8gMkNajyJE7h0SBFbfW AxHDFSAZiuHzsVi4/zXewSti68xh1HQfiq3IMNH1PnZMibmi3trNFynB1z94IlHfQlK+ FWPgWPxQIp92jDx1i0clqFzv2i+dZg4uZrs0K6fYNRDigh+JRH8OO9aauWm7hQPviSTQ FEezMxXVxCw7Rn8ynzVd5w0SiXGLvIerqLIewihAZfOtEXGyyqGLcgOLEu9ZURJG677G ODIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=RF1A5CN+; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a9-v6si3007126pfe.29.2018.10.02.07.38.55; Tue, 02 Oct 2018 07:39:10 -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=@gmail.com header.s=20161025 header.b=RF1A5CN+; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728543AbeJBVWV (ORCPT + 99 others); Tue, 2 Oct 2018 17:22:21 -0400 Received: from mail-qk1-f194.google.com ([209.85.222.194]:47068 "EHLO mail-qk1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726118AbeJBVWU (ORCPT ); Tue, 2 Oct 2018 17:22:20 -0400 Received: by mail-qk1-f194.google.com with SMTP id q12-v6so1237786qkl.13 for ; Tue, 02 Oct 2018 07:38:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=UsjZUHavM6O3QeH6tlq9dIQpwA6ici9MyEp6E87EPfo=; b=RF1A5CN+VgnkMaCUNY8x/Qy+t4Q5442SjsP3EenwUXh8zrCGg+HOUCFICtLm5kGmZb qGEf6eidZUJ7ZFgMWhSC+3rGaQFGmCzaB0IpN0543MRBR0HmX/TuFG07MOl9pjntvn8p OTch1tkAsYoKZ9rcoiVYHvaoXJKBWZysu15Q9PCONFnFLqu2CnIVuvT+CshjEjCyAu3K 21eg1wxq6DMqpDsJlK3cMAPrWMNplkKR5+YMLZ9fFzHzELHmE1BMQBNblCGnNjDiQWVB inqcs73RrhZtkY9ezDvzYl/0hVsKmaB02tiyDWE+mEOs1FnOxoQvCoZukHs96J0sYeNB 9n1A== 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:in-reply-to :references; bh=UsjZUHavM6O3QeH6tlq9dIQpwA6ici9MyEp6E87EPfo=; b=HvJAeOZn85QIgKwxp5lVvO2kC6Yj+7Nn1N+uBN/rt5HYNUcTMIIxZOMjavWRG8rD8G HBA+okH21RaJY2PNLqt5ISvdeh7mi4FMVE1oejqSLrUl5NHDyS7/kPTTsYpXvo1hh8/P 0F+IbP8p0Rk5DEKhVqnmzJSfbEPIEFYFbyraosPP8p6BcfGyQ4+Gz7WDeo4AU/CASAaF fdjOLZbRLI0O+Eh+8/YaQppjUK/ZreFxPWiniRZ/qw3QVQxMzEmBh3NVBgtN1t09hgAr Rx0mbcVeVbKpD0ZG0BtScSy/0Z8rFJj1KHqDYCPEScKkflISVucEaDmToKruJz67N3CD 88mQ== X-Gm-Message-State: ABuFfoj5XZp3QV+kK43u2SgPfzuFxF73GnL1GstorB9LP8d+UQxHneRF 81t8w4oXnkllSDW/geGCMw== X-Received: by 2002:a37:a650:: with SMTP id p77-v6mr12032868qke.126.1538491117434; Tue, 02 Oct 2018 07:38:37 -0700 (PDT) Received: from gabell.bos.redhat.com (nat-pool-bos-t.redhat.com. [66.187.233.206]) by smtp.gmail.com with ESMTPSA id y20-v6sm5257538qkb.46.2018.10.02.07.38.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 02 Oct 2018 07:38:37 -0700 (PDT) From: Masayoshi Mizuma To: linux-mm@kvack.org, Naoya Horiguchi , Pavel Tatashin , Michal Hocko , Thomas Gleixner , Ingo Molnar Cc: Masayoshi Mizuma , Masayoshi Mizuma , linux-kernel@vger.kernel.org, x86@kernel.org Subject: [PATCH v3 3/3] Revert "x86/e820: put !E820_TYPE_RAM regions into memblock.reserved" Date: Tue, 2 Oct 2018 10:38:21 -0400 Message-Id: <20181002143821.5112-4-msys.mizuma@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181002143821.5112-1-msys.mizuma@gmail.com> References: <20181002143821.5112-1-msys.mizuma@gmail.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Masayoshi Mizuma commit 124049decbb1 ("x86/e820: put !E820_TYPE_RAM regions into memblock.reserved") breaks movable_node kernel option because it changed the memory gap range to reserved memblock. So, the node is marked as Normal zone even if the SRAT has Hot pluggable affinity. ===================================================================== kernel: BIOS-e820: [mem 0x0000180000000000-0x0000180fffffffff] usable kernel: BIOS-e820: [mem 0x00001c0000000000-0x00001c0fffffffff] usable ... kernel: reserved[0x12]#011[0x0000181000000000-0x00001bffffffffff], 0x000003f000000000 bytes flags: 0x0 ... kernel: ACPI: SRAT: Node 2 PXM 6 [mem 0x180000000000-0x1bffffffffff] hotplug kernel: ACPI: SRAT: Node 3 PXM 7 [mem 0x1c0000000000-0x1fffffffffff] hotplug ... kernel: Movable zone start for each node kernel: Node 3: 0x00001c0000000000 kernel: Early memory node ranges ... ===================================================================== The original issue is fixed by the former patches, so let's revert commit 124049decbb1 ("x86/e820: put !E820_TYPE_RAM regions into memblock.reserved"). Signed-off-by: Masayoshi Mizuma Reviewed-by: Pavel Tatashin --- arch/x86/kernel/e820.c | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/arch/x86/kernel/e820.c b/arch/x86/kernel/e820.c index c88c23c..d1f25c8 100644 --- a/arch/x86/kernel/e820.c +++ b/arch/x86/kernel/e820.c @@ -1248,7 +1248,6 @@ void __init e820__memblock_setup(void) { int i; u64 end; - u64 addr = 0; /* * The bootstrap memblock region count maximum is 128 entries @@ -1265,21 +1264,13 @@ void __init e820__memblock_setup(void) struct e820_entry *entry = &e820_table->entries[i]; end = entry->addr + entry->size; - if (addr < entry->addr) - memblock_reserve(addr, entry->addr - addr); - addr = end; if (end != (resource_size_t)end) continue; - /* - * all !E820_TYPE_RAM ranges (including gap ranges) are put - * into memblock.reserved to make sure that struct pages in - * such regions are not left uninitialized after bootup. - */ if (entry->type != E820_TYPE_RAM && entry->type != E820_TYPE_RESERVED_KERN) - memblock_reserve(entry->addr, entry->size); - else - memblock_add(entry->addr, entry->size); + continue; + + memblock_add(entry->addr, entry->size); } /* Throw away partial pages: */ -- 2.18.0