From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 54D2EC433F5 for ; Thu, 3 Feb 2022 00:21:20 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C42A58D0122; Wed, 2 Feb 2022 19:21:19 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id BF14F8D0119; Wed, 2 Feb 2022 19:21:19 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A91DA8D0122; Wed, 2 Feb 2022 19:21:19 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0111.hostedemail.com [216.40.44.111]) by kanga.kvack.org (Postfix) with ESMTP id 977E18D0119 for ; Wed, 2 Feb 2022 19:21:19 -0500 (EST) Received: from smtpin18.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 51E499A7FF for ; Thu, 3 Feb 2022 00:21:19 +0000 (UTC) X-FDA: 79099564278.18.539178E Received: from mail-ed1-f44.google.com (mail-ed1-f44.google.com [209.85.208.44]) by imf31.hostedemail.com (Postfix) with ESMTP id 0184920003 for ; Thu, 3 Feb 2022 00:21:18 +0000 (UTC) Received: by mail-ed1-f44.google.com with SMTP id w14so2010728edd.10 for ; Wed, 02 Feb 2022 16:21:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:subject:message-id:reply-to:references:mime-version :content-disposition:in-reply-to:user-agent; bh=IdXalSMLN5MQoDxyTGMqoaaPaAweitgBHjd8kg4ci/8=; b=B2ItoGc/UIqEjP1EtvhDX7ho5pmcYfPwRzTzYM+bQgbEfUcNeK98sZ9I90j33tOTH4 sTIj3xEfRC6Q409RVb61g8PmBPuPA7JSVaaxWUpcflFC7R4afG8Nw0zjg63zdmvYA5zX zHvjqW4S9WhZ4E3NQ3fDUOSdhHGfwgdmoIt2jXXw/nxgzlGIh1Nm5VM4s38rMPpFufL9 jWFAX55PHHLGgFaoqvdBuRIr5QCrGYkSdVICSLzQs2dvQ5QYRRb2uky5165DIoxMB5o/ OOxJt2hSK9g6GGfSiRvH0l8BZttbowKMFzw1nziIlEErLUAEGTwo8PcgcfVJt6AbK8+6 GXJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:reply-to :references:mime-version:content-disposition:in-reply-to:user-agent; bh=IdXalSMLN5MQoDxyTGMqoaaPaAweitgBHjd8kg4ci/8=; b=mkS1U0MJCjmxy67pPKBwdIULQJ5+VW4K5JtIfAxwNzX8Jh7s95f4W5kffYc41fZTZc cVbMwo5AswyzA3OIxJdOXZvHvLcq8+p2WvjG45A2ciJkW9VaUIRlR/xpwEMUl7WuU8Ni 4grHKWc0LI/EXJLh4+pquRaIjVK82v2BIBJfjirW8N8QvbjcdQF8kXlIWyoUMMyWewZs CzeMOTs/B4y979RIpzAqXiJ+OHPXYbQ+Vdh+hCm84LA/jkVjIyLMVx2FUdKfJh64rc46 I0evu/w1RphLRArroeHhvU6XknCi6ia64BcDAspqZnl0qr9EGH27fqs74meYvlZrMZam J3kw== X-Gm-Message-State: AOAM533cPNXu+7CmUUresAYHyraax++CcJtB2MULZWsQD2DmblRZ0rE/ z7+Nvpa9qvbvYyYa1idzFmM= X-Google-Smtp-Source: ABdhPJyuDiD3h5OVCT0rc9EdD17oOKJhIr3vzwxaQcUHZkkDpTyr0U78BDdif6JeY6wVv2fEUYZsog== X-Received: by 2002:a05:6402:440c:: with SMTP id y12mr32582521eda.75.1643847677599; Wed, 02 Feb 2022 16:21:17 -0800 (PST) Received: from localhost ([185.92.221.13]) by smtp.gmail.com with ESMTPSA id d26sm21522240edy.92.2022.02.02.16.21.17 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 02 Feb 2022 16:21:17 -0800 (PST) Date: Thu, 3 Feb 2022 00:21:16 +0000 From: Wei Yang To: Michal Hocko Cc: Wei Yang , Mike Rapoport , Andrew Morton , linux-mm@kvack.org, LKML , David Hildenbrand , Alexey Makhalov , Dennis Zhou , Eric Dumazet , Oscar Salvador , Tejun Heo , Christoph Lameter , Nico Pache , Rafael Aquini Subject: Re: [PATCH 2/6] mm: handle uninitialized numa nodes gracefully Message-ID: <20220203002116.akpk5um5nkpeflve@master> Reply-To: Wei Yang References: <20220127085305.20890-1-mhocko@kernel.org> <20220127085305.20890-3-mhocko@kernel.org> <20220201024119.2ailcw4rp5thambz@master> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20170113 (1.7.2) Authentication-Results: imf31.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b="B2ItoGc/"; spf=pass (imf31.hostedemail.com: domain of richard.weiyang@gmail.com designates 209.85.208.44 as permitted sender) smtp.mailfrom=richard.weiyang@gmail.com; dmarc=pass (policy=none) header.from=gmail.com X-Rspam-User: nil X-Rspamd-Queue-Id: 0184920003 X-Stat-Signature: ybrs3hp7epspzcofzj3bgfa5uoozg35f X-Rspamd-Server: rspam12 X-HE-Tag: 1643847678-906162 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Tue, Feb 01, 2022 at 10:54:37AM +0100, Michal Hocko wrote: >On Tue 01-02-22 02:41:19, Wei Yang wrote: >> On Thu, Jan 27, 2022 at 03:47:40PM +0100, Michal Hocko wrote: >> [...] >> >> > + /* >> >> > + * not marking this node online because we do not want to >> >> > + * confuse userspace by sysfs files/directories for node >> >> > + * without any memory attached to it (see topology_init) >> >> > + * The pgdat will get fully initialized when a memory is >> >> > + * hotpluged into it by hotadd_init_pgdat >> >> > + */ >> >> Hmm... which following step would mark the node online? On x86, the node is >> onlined in alloc_node_date(). This is not onlined here. > >The comment tries to explain that this happens during the memory >hotplug. Or maybe I have missed your question? > I am not sure for others, while the comment confused me a little. Currently in kernel, there are two situations for node online: * during memory hotplug * during sys-init For memory hotplug, we allocate pgdat and online node. And current hot-add process has already put them in two steps: 1. __try_online_node() 2. node_set_online() So emphasize "not online" node here, confuse me a little. It is a natural thing to not online node until it has memory. But from another point of view, the comment here is reasonable. During sys-init, we online node at the same time when creating pgdat. And even for memory-less node on x86, we online them too. Well, this is all about the comment. I have tried to grab may head but not come up with a better idea. Or maybe this is just my personal feeling, don't bother if no-one else feel like this. >[...] >-- >Michal Hocko >SUSE Labs -- Wei Yang Help you, Help me