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 DD7F5C433F5 for ; Thu, 3 Feb 2022 07:23:34 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 558768D012D; Thu, 3 Feb 2022 02:23:34 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 507178D0124; Thu, 3 Feb 2022 02:23:34 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3CF8F8D012D; Thu, 3 Feb 2022 02:23:34 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0055.hostedemail.com [216.40.44.55]) by kanga.kvack.org (Postfix) with ESMTP id 2CEAA8D0124 for ; Thu, 3 Feb 2022 02:23:34 -0500 (EST) Received: from smtpin30.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id DF00C181616C8 for ; Thu, 3 Feb 2022 07:23:33 +0000 (UTC) X-FDA: 79100628306.30.786AD64 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by imf27.hostedemail.com (Postfix) with ESMTP id 51D6640005 for ; Thu, 3 Feb 2022 07:23:33 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 88762B832B7; Thu, 3 Feb 2022 07:23:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 066B8C340E4; Thu, 3 Feb 2022 07:23:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1643873010; bh=V7K25jTCXoH0BgptRaT8871n6m7moa8rRIaz4V09veo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=RKw9Genp3FGTt2PlwobnsNfAJd3NNgCpYX/1le+66knL+/J7tFRofkqmYKxCTbPue xoyVEhRy1VHb1WtymQt8gT0tEDoIfs+LKL2sVVGXq+7Djfb3tv8SInfjnSA/CA/FyM gQnK2aICmjWgOvqXelPpZ48MCIs9E6DdXhqOIvZCd7rVTV1EdMkd8U0mUljIL4LWG5 2sO8+4/DNxYVkCMdvBkupaP9AEKUmENro33UH7/tMX0Jr0ps11dYV7B6fmQFp7Io24 PsuZI0LhDwrVjKF63sNhXxsfxDLOUdl0soaydxG2WMrGpHlJ8XmYI6sK4ck8+WOQYD 44qVAfI2Fufuw== Date: Thu, 3 Feb 2022 09:23:20 +0200 From: Mike Rapoport To: Wei Yang Cc: Michal Hocko , 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: References: <20220127085305.20890-1-mhocko@kernel.org> <20220127085305.20890-3-mhocko@kernel.org> <20220201024119.2ailcw4rp5thambz@master> <20220203002116.akpk5um5nkpeflve@master> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220203002116.akpk5um5nkpeflve@master> X-Rspamd-Server: rspam11 X-Rspamd-Queue-Id: 51D6640005 X-Stat-Signature: 4bdtukgudxf6a1191jztq4zbu7tfyprg Authentication-Results: imf27.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=RKw9Genp; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf27.hostedemail.com: domain of rppt@kernel.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=rppt@kernel.org X-Rspam-User: nil X-HE-Tag: 1643873013-951179 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 Thu, Feb 03, 2022 at 12:21:16AM +0000, Wei Yang wrote: > 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. I shuffled the words a bit, maybe this sounds better not only to me :) /* * We do not want to confuse userspace by sysfs files/directories for node * without any memory attached to it, so this node is not marked as * N_MEMORY and not marked online so that topology_init() won't create * sysfs hierarchy for this node. The pgdat will get fully initialized by * hotadd_init_pgdat() when memory is hotpluged into this node */ -- Sincerely yours, Mike.