Received: by 2002:a05:7412:1e0b:b0:fc:a2b0:25d7 with SMTP id kr11csp980129rdb; Fri, 16 Feb 2024 01:15:28 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVpM8YYNqhuH/7oSNX9FZDzdZ0JafygQ0H2VWyF0gkKVaMzyBIpMQKERABwFmsacgWBR2LpvXFeeG4cEpbo/XPx7svnmkW7uu1onYMAWg== X-Google-Smtp-Source: AGHT+IHUe2Khc2eFjKLGps2tnw/f+jUVsN9uEuEtywA/3m3YDgON/ZqDG5xXltj84TthDnvdcKc9 X-Received: by 2002:a05:6870:4691:b0:218:d3dc:67de with SMTP id a17-20020a056870469100b00218d3dc67demr5217256oap.22.1708074928297; Fri, 16 Feb 2024 01:15:28 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708074928; cv=pass; d=google.com; s=arc-20160816; b=xr5WzBc+KGq80y07qTDeCYrKFOXR1m9y1gOPlLhrpb8RJZjewbZV9iRz26/OtY8DOg UZRhkKM2+LIngFhfd/SEs0WUS9G00CgeCaLcDqc1Ztyym2GdlOvqTKoF7Tsi4lGe7yMz q1Y1Nz9gbtVKlUtzFp5QUp8FzjbiUepLF2ayPbMwMJWIGYFnggGqTqKlPMR4au19gg+l PUEQ/GjJh20VrA/wLvZfMW4jxM7m/1h16S81lr+gyUh3YlOdMfPinAX0B2MAOKFD122D ePC/+V6wxlOMNiDZ49PNBHKfa2wzI+CRZGspnEH+fVC+4cJAqv8JaaSbQvLVJhXga5CD Xh+g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=user-agent:in-reply-to:content-disposition:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:references :message-id:subject:cc:to:from:date; bh=tcgj4V9LKgIykr3hRYm2x/tFcmwC/6gKOyKa8hpSeBA=; fh=H1AXMuko56EfY+4pMcUqDLIow0rsGAnFgbDVYODEbGY=; b=muBhMovSX+HAJpM8Zf5II0y2Gqm31P5QSPG0QIOG86FuZCHBuFXCxnd6B0HzxCzGZm zhEraE6cAzEuaaOJXRpJ+E5YxYWIHWTHemTng8wtLMNmS3OrrA2Ji/6sLo4EI+3ljGyk HHVs9HUFrkNBRljwLxNg1LRnhW4cHVrtHnfRJQU+zvwdEptp+55GS6y2GfVB/ZN8+VdQ K1zxPoFtfFDuinC1HXPwiVyBNEye5QCKJlD8arTsJsCgN2sKIfZze8Af5XIrix031LoI KsO4DylEaDDxfR4B7T6evuro6n8EH7jtc8fLEuGKsswHXt8UjDQzlmFUySs/DDwD1lMI Za/w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=sk.com); spf=pass (google.com: domain of linux-kernel+bounces-68313-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-68313-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id n23-20020a637217000000b005cdf8b03384si2688237pgc.805.2024.02.16.01.15.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Feb 2024 01:15:28 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-68313-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=sk.com); spf=pass (google.com: domain of linux-kernel+bounces-68313-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-68313-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id F3236B22BD1 for ; Fri, 16 Feb 2024 09:12:11 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5AFEE1B941; Fri, 16 Feb 2024 09:12:04 +0000 (UTC) Received: from invmail4.hynix.com (exvmail4.hynix.com [166.125.252.92]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 633D517BD6 for ; Fri, 16 Feb 2024 09:11:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=166.125.252.92 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708074723; cv=none; b=J/42BKfAT6lzZWw6WcaWa70SmMtQTSry7z26QdrFb3WU9zoWLwBYWAOnerXR/14ZbnTmnTsHhRau0VuIcLdBlyx2Pen6FegX+fsszKzd0dP7nFRw0hNLtnIdgZ5Tuc+bVR1a1r4ZtowKd92W2BfQwZk3ERXG87rNqoqDK1E4yoM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708074723; c=relaxed/simple; bh=Ryp7q8VfnYfLCvqepfziSt+wAlGU+XTSlKDD0RP5Vxc=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=AcaMqJRRfUaJ494cBi4Yv8Of8CmGtaMJl1E442i/g7l4IONteX+a9v6RQBh1t2xlKTOYwsyMBSx3hynC5y2GHbSlV7VYZnZXFxp0qh4p7gbVJr6eR20copBBStRS2bcY5P/s1RxgGzq36ve6TT7OONznEjok+i0zwaYXZcH/4m8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=sk.com; spf=pass smtp.mailfrom=sk.com; arc=none smtp.client-ip=166.125.252.92 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=sk.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=sk.com X-AuditID: a67dfc5b-d6dff70000001748-b0-65cf26d1d245 Date: Fri, 16 Feb 2024 18:11:40 +0900 From: Byungchul Park To: Oscar Salvador Cc: mingo@redhat.com, peterz@infradead.org, juri.lelli@redhat.com, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de, bristot@redhat.com, vschneid@redhat.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org, kernel_team@skhynix.com, akpm@linux-foundation.org Subject: Re: [PATCH] sched/numa, mm: do not promote folios to nodes not set N_MEMORY Message-ID: <20240216091139.GA75176@system.software.com> References: <20240214035355.18335-1-byungchul@sk.com> <20240216070754.GB32626@system.software.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFupjkeLIzCtJLcpLzFFi42LhesuzSPei2vlUg2nHxS3mrF/DZnHp8VU2 i+kvG1ksnk7Yymxxt38qi8XlXXPYLO6t+c9qMfndM0aLSwcWMFmcmVZkcbz3AJPFvo4HTBYd R74xW2w9+p3dgc9jzbw1jB4t+26xeyzYVOqxeYWWx6ZPk9g97lzbw+ZxYsZvFo/3+66yeWw+ Xe3xeZNcAFcUl01Kak5mWWqRvl0CV0bD+4nMBT+4Kn43PGZuYLzO0cXIySEhYCKx9NJndhj7 SGcjM4jNIqAqMf9YP1icTUBd4saNn2BxEQE1iWmvGoHiXBzMAqeYJCZ8vgDkcHAIC4RJ/H2j AFLDK2AhceT/KlaQGiGBXYwS19YsYINICEqcnPmEBcRmFtCSuPHvJRNIL7OAtMTyfxwgJqeA qcTfNTUgFaICyhIHth1nAhkjIdDMLrFi3yOoOyUlDq64wTKBUWAWkqmzkEydhTB1ASPzKkah zLyy3MTMHBO9jMq8zAq95PzcTYzAWFpW+yd6B+OnC8GHGAU4GJV4eA/8OZsqxJpYVlyZe4hR goNZS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Pfuq31Qwt+Rqbzxl+e9mX9uXY/7 8fOSRty05VOtUuK4Nz3bncz/S4mlOCPRUIu5qDgRAArQxHCIAgAA X-CFilter-Loop: Reflected On Fri, Feb 16, 2024 at 08:52:30AM +0100, Oscar Salvador wrote: > On Fri, Feb 16, 2024 at 04:07:54PM +0900, Byungchul Park wrote: > > For normal numa nodes, node_data[] is initialized at alloc_node_data(), > > but it's not for memoryless node. However, the node *gets onlined* at > > init_cpu_to_node(). > > > > Let's look at back free_area_init(). free_area_init_node() will be called > > with node_data[] not set yet, because it's already *onlined*. So > > ->zone_pgdat cannot be initialized properly in the path you mentioned. > > I am might be missing something., so bear with me. > > free_area_init() gets called before init_cpu_to_node() does. > free_area_init_node() gets called on every possible node. > > free_area_init_node then() does > > pg_data_t *pgdat = NODE_DATA(nid);, > > and then we call free_area_init_core(). > > free_area_init_core() does > > free_area_init_core() does > zone_init_internals() > > which ends up doing zone->zone_pgdat = NODE_DATA(nid); > > If node_data[] was not set at all, we would already blow up when doing > the first > > for_each_node() > pgdat = NODE_DATA(nid); > free_area_init_node(nid); > > back in free_area_init(). It seems that I got it wrong about the reason. Let me check it again and share the reason. Just in case, this patch is still definitely necessary tho. Byungchul