Received: by 2002:a4a:301c:0:0:0:0:0 with SMTP id q28-v6csp1129480oof; Tue, 25 Sep 2018 08:37:45 -0700 (PDT) X-Google-Smtp-Source: ACcGV61zFf/Z5fcWxu5Oqac+zQwbQAhtn7Sevtsm589+lO/pJt65lAIJJT2HGIaaR8qzD18o/Kci X-Received: by 2002:a62:6643:: with SMTP id a64-v6mr1728884pfc.202.1537889865498; Tue, 25 Sep 2018 08:37:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537889865; cv=none; d=google.com; s=arc-20160816; b=H1N7xjqbtWxTmesCqM5TtBHiLykZduzdUFWN26qAdQwDwAuaL8fgoFlwUZt+Ki56ip LWP0L6dqg9wpPjx5dYXRxzhnVXwZ4A0cxLV2H8AHOmqg3FG0gXaSFeFrIdieV3R9wbvM oCOInVoGlaIRL4XMRiSU6hOdpOGZTzlBy0rvuMT3wPzQfkEX/JYg/cogkJyHty+Sx30b 87NRdfR3mEQVaS5YuAmO9OYIU/LiPAP8MaRiyktHYOnwE2RvtSxGuQVmsVI5f/2bdFSX osVCtdNrj/FMVUcouR4c9wOa0Q/OPaJmmUh4O087gk+bIx1fYw59yBpi+9Wnjm8u814Z HJSw== 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=xP66oGEF+u9f7BSpkmxqbqRaFwS1WpxA5GQ7jYe350c=; b=ZrLTrEWRhzVbAbupVtr1vnsjhbwrFHPATYSgQWHtYRdUID49TSDwa638cTtWBGzP2p RbJ/9NUjtcm7d+/cnQFhd9JbhdNtE+Bdm2IksnYr69BOJdnFdd6ebCxaS6M0knHOjE/+ xeY2pYK6TNZjtRSNRYXaV3AxECxm4KvJrfSttT+Lj6utNk3QA6mimBa5xXW0ImYnyc7h 2urUQLJYoTJWNSBDXW96zdCg3+HfmkFa6rIWML1QranPHO5WcDvCyj4nlxz8u/0o1ibH po8FwEKH9MMvewMkBKC0qcq65us+POv1o3dzNYa9bI3URvQuefRfLMUbvSbQa8jiZk7b AQHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=oI6y2THg; 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 29-v6si2629225pgv.292.2018.09.25.08.37.30; Tue, 25 Sep 2018 08:37:45 -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=oI6y2THg; 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 S1729710AbeIYVoA (ORCPT + 99 others); Tue, 25 Sep 2018 17:44:00 -0400 Received: from mail-qk1-f196.google.com ([209.85.222.196]:32952 "EHLO mail-qk1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729306AbeIYVn7 (ORCPT ); Tue, 25 Sep 2018 17:43:59 -0400 Received: by mail-qk1-f196.google.com with SMTP id 84-v6so2289984qkf.0 for ; Tue, 25 Sep 2018 08:35:55 -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=xP66oGEF+u9f7BSpkmxqbqRaFwS1WpxA5GQ7jYe350c=; b=oI6y2THgwRwZfWatTuq71tZoL7JPsb0d8wRg3VmKIJs0PweEHxN6UwDgsQf69CM5mo 7clALQKSkomrbGRH/nvJU2xRh18/oawDo7AREjUzMbnEeUni5Hbbl9f+frpg0wl2evRK J54s4z+Me5J5+heT3vrgk896QPUrAjfkPd4gyXYs+WHRs3T+1Swfu7bgCD5jQaYSWdKh RU1i7+pT5+xUJ1HyY5+dLCH8KnWLoUHDYW115dPvFL++dSOToBA766v4G2zFJOS1Xx23 HNPm/yWVg/u6yZR6V7mkcF9nVfdGMwvH2w+tcVssQjB5WtHlj2levmbUcmDTmkqua9w+ oMpw== 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=xP66oGEF+u9f7BSpkmxqbqRaFwS1WpxA5GQ7jYe350c=; b=GPAvOTxy9xHtnrCXFJxghEc53t6nhWEi61HpltDVy+awds4CiFGj8wb7mbAZbcNcUD uQUBnl90k46PQrCCmvAoFpWs5T7OQcOJVjxKzb2sqxtn1NCGlq8k7Ug0Gwc9/E5wLWWB QhvyGTuvZhbMWcGbrCUVxTSubs29F1tnFP8qmc2TWQqtYivKdMbgLE32ySkEBXI77t5t 1aZjkzEwnCmJgUW2AXVHhT7Y7zCzHR7VNPp3JPceh6hUV+ugPCaL/nZnBSJGOBWSLsmK 3GH/vK+Aqkm1vbLLF/idMZ/qH8UW0fYyladQrX7C6bGGNlTE2IBl5hk5w/jJGJRLXki/ oHwQ== X-Gm-Message-State: ABuFfoi6VqxrehUXttHAKicsnLDkXzMW8yAkxn8/aBGwmTCbGIcJTuKG ZiihJIvGST4l5rx23tdcrA== X-Received: by 2002:a37:cf04:: with SMTP id e4-v6mr1115171qkj.241.1537889755274; Tue, 25 Sep 2018 08:35:55 -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 p18-v6sm2056304qtp.3.2018.09.25.08.35.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 25 Sep 2018 08:35:54 -0700 (PDT) From: Masayoshi Mizuma To: linux-mm@kvack.org, Naoya Horiguchi , Pavel Tatashin , Michal Hocko Cc: Masayoshi Mizuma , Masayoshi Mizuma , linux-kernel@vger.kernel.org, x86@kernel.org Subject: [PATCH v2 1/3] Revert "x86/e820: put !E820_TYPE_RAM regions into memblock.reserved" Date: Tue, 25 Sep 2018 11:35:30 -0400 Message-Id: <20180925153532.6206-2-msys.mizuma@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180925153532.6206-1-msys.mizuma@gmail.com> References: <20180925153532.6206-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 plaggable 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 ... ===================================================================== Naoya's v1 patch [*] fixes the original issue and this movable_node issue doesn't occur. Let's revert commit 124049decbb1 ("x86/e820: put !E820_TYPE_RAM regions into memblock.reserved") and apply the v1 patch. [*] https://lkml.org/lkml/2018/6/13/27 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