Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp455858ybz; Wed, 22 Apr 2020 01:23:04 -0700 (PDT) X-Google-Smtp-Source: APiQypJWhvmnOeWYD5KS1MI+/KQ8WC/gdOLePvhaVfCU0hdp46taUHfgC2l7KoZchR9yNalDf58Z X-Received: by 2002:a17:906:808:: with SMTP id e8mr24612983ejd.372.1587543784614; Wed, 22 Apr 2020 01:23:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587543784; cv=none; d=google.com; s=arc-20160816; b=cuyItTYeVIZIihWS73CWySyL0uhlAAwGgw5dCZgua5w7Jzydz50zfhwHe/EchXemqY 7xtE0JMY0F82BaaziY7qTBMWEVQHWAObeOvB06cewuNoXqp5OJc6vijUMFChEryL1RKE GJoRIgSkdunNeLuu4BcEmMIs9fMb77vrPf+cmTSmnqNxpPrWAcIuv/Fx0OH+/tMHut+R 4/SjbqUBzh7FpsXWEa7LAuNEkCE6gRCPSBbkvMSCvM4NOCNMVHHypGISTEy5FNBmqWVK 1QeRsyY2g9E8sh1xkasG5ecto8QsqfY5qL8hZ9elnoOd+C6el1KulieS6xUSwrhfD5Ni +8rw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=5NU5ZhAJHq6ciQrPGIfc8KggoL6wwkS48uukTc3+gvE=; b=Kv+ENBh8GPn8c2O1tlpaV0bf4bsUCFUoqSjeGrV9jMCwnq9OtH4AJO14vVDQIAC2Yc DlcodH1t0sSfdeM+bwxuupsOzjL3oMzkmZeitV9UQR8x4HOnKHYWc7CUt70h3ZFUVthq 5PWDNyfSh0bfZlMVVKEGCV3JcA0cxr/lTQcbYo9n2PoDP8Ihp5rQwU9MIAaYx5wAbaYc C5HSyusQk+PESWP5v+gShN1lvx2YNbc66ocbIR7v+RjPxSgxcYd5dQqZt8YZanw5KQTd gkhkbQmeT71F9kkH1MZIjlTWfMOB9s7HIE75rRfGa30ga6+BllZHf2BjgjtyjbmD4r3s fbMg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t20si2855026edy.543.2020.04.22.01.22.41; Wed, 22 Apr 2020 01:23:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726423AbgDVIVG (ORCPT + 99 others); Wed, 22 Apr 2020 04:21:06 -0400 Received: from mail-wm1-f68.google.com ([209.85.128.68]:40301 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725811AbgDVIVF (ORCPT ); Wed, 22 Apr 2020 04:21:05 -0400 Received: by mail-wm1-f68.google.com with SMTP id u16so1254378wmc.5 for ; Wed, 22 Apr 2020 01:21:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=5NU5ZhAJHq6ciQrPGIfc8KggoL6wwkS48uukTc3+gvE=; b=pBtTMX6urHD3zMpTlI7A33CIycrah7Sp0vaZWZsjV8IcX3CoV2ImfbFtP3YJeHQfS4 t4PEc+HE9xRbgfOZvhfx8Hv71vOSsesmdvSS9ZXAumQca/tob1QjqNVdnKVp/HqMtATW AiFP3naqJBItvtdYLwhl6fpFBxxRvATIouHqOz1UmyqxtULPYcVBy6oEpsnuJ6wiZq2H h4gyGQskghYTpkufjx0w0BXyo2HcBsdM2JCpoY6aQNhQ+oeIbrz2r9aAmrPlmxTqk0lF hw5TkNX1D80oB4/imsMbC/AqAac4su75EMbBOVbsxLGuy1MU3ie+47nfE6w8O8V8DM3E 04/g== X-Gm-Message-State: AGi0Pubtg07Oedn81wbuIurVNjjynPQaLG/388F6nDa2noAzZZ3XzXf0 rnApplpG1v1oudBTK4z2Img= X-Received: by 2002:a1c:4346:: with SMTP id q67mr9023354wma.162.1587543663505; Wed, 22 Apr 2020 01:21:03 -0700 (PDT) Received: from localhost (ip-37-188-130-62.eurotel.cz. [37.188.130.62]) by smtp.gmail.com with ESMTPSA id f7sm7011365wrt.10.2020.04.22.01.21.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Apr 2020 01:21:02 -0700 (PDT) Date: Wed, 22 Apr 2020 10:21:01 +0200 From: Michal Hocko To: David Hildenbrand Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, Andrew Morton , Baoquan He , Oscar Salvador , Pankaj Gupta Subject: Re: [PATCH RFC 1/2] mm/memory_hotplug: no need to init new pgdat with node_start_pfn Message-ID: <20200422082101.GC30312@dhcp22.suse.cz> References: <20200416104707.20219-1-david@redhat.com> <20200416104707.20219-2-david@redhat.com> <20200421123011.GE27314@dhcp22.suse.cz> <20200421125250.GG27314@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue 21-04-20 15:06:20, David Hildenbrand wrote: > On 21.04.20 14:52, Michal Hocko wrote: > > On Tue 21-04-20 14:35:12, David Hildenbrand wrote: > >> On 21.04.20 14:30, Michal Hocko wrote: > >>> Sorry for the late reply > >>> > >>> On Thu 16-04-20 12:47:06, David Hildenbrand wrote: > >>>> A hotadded node/pgdat will span no pages at all, until memory is moved to > >>>> the zone/node via move_pfn_range_to_zone() -> resize_pgdat_range - e.g., > >>>> when onlining memory blocks. We don't have to initialize the > >>>> node_start_pfn to the memory we are adding. > >>> > >>> You are right that the node is empty at this phase but that is already > >>> reflected by zero present pages (hmm, I do not see spanned pages to be > >>> set 0 though). What I am missing here is why this is an improvement. The > >>> new node is already visible here and I do not see why we hide the > >>> information we already know. > >> > >> "information we already know" - no, not before we online the memory. > > > > Is this really the case? All add_memory_resource users operate on a > > physical memory range. > > Having the first add_memory() to magically set node_start_pfn of a hotplugged > node isn't dangerous, I think we agree on that. It's just completely > unnecessary here and at least left me confused why this is needed at all- > because the node start/end pfn is only really touched when > onlining/offlining memory (when resizing the zone and the pgdat). I do not see any specific problem. It just feels odd to ignore the start pfn when we have that information. I am little bit worried that this might kick back. E.g. say we start using the memmaps from the hotplugged memory then the initial part of the node will never get online and we would have memmaps outside of the node span. I do not see an immediate problem except for the feeling this is odd. That being said I will shut up now and leave it alone. [...] > > Btw. one thing that I have in my notes, I was never able to actually > > test the no numa node case. Because I have always been testing with node > > being allocated during the boot. Do you have any way to trigger this > > path? > > Sure, here is my test case > > #! /bin/bash > sudo qemu-system-x86_64 \ > --enable-kvm \ > -m 4G,maxmem=20G,slots=2 \ > -smp sockets=2,cores=2 \ > -numa node,nodeid=0,cpus=0-1,mem=4G -numa node,nodeid=1,mem=0G \ I have been using a similar command line NUMA_ONE_MEMORY_LESS_NODE="-numa node,mem=2G -numa node,mem=0G" which gets appended to the qemu cmdline. I have always thought that this would allocate pgdat for node 1 though. I have checked that again now and dmesg doesn't point to node 1 anywhere. Thanks! -- Michal Hocko SUSE Labs