Received: by 2002:a05:7412:1e0b:b0:fc:a2b0:25d7 with SMTP id kr11csp1034436rdb; Fri, 16 Feb 2024 03:26:57 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVMJyCSmCfndy5O6QjEZzu91rvSXtjD/x818S0UzBJJG4neIz9nMtBLc648anJLsfsxg0WIhPPTXk27kMuBIYrCmumxchUfOoI+RhZylQ== X-Google-Smtp-Source: AGHT+IHvCUkOHeGVLftkrXlz1wsQYuqFUP4QEsFDXI46ntXANF0S8sP1IayNiKGS/6gU0yuVsypX X-Received: by 2002:a05:6870:e9a1:b0:21a:5866:f619 with SMTP id r33-20020a056870e9a100b0021a5866f619mr4555019oao.27.1708082817650; Fri, 16 Feb 2024 03:26:57 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708082817; cv=pass; d=google.com; s=arc-20160816; b=OQ63TJEFt2+tq8Tww76bZAJUMQ5P6qJcJtWyFjC75JME2NaWPzgUYntGp99YKgveDl oOeTFEQYJMoDM14Vh7zSMN6ZQjIiZarRuzhHF+QXJMCEH99a7FQobOawXB5uIj3g5rBC xjIjKL6iYobriHpNdBRF7hZHf6DhGhPKv97fL5X04PgZFG0Wi1VuyvabaKKpeKUJFu8e CHVyyaTNMyDuCGQBzJziTSrdRTv+7nF60A0e6X0mhJW2oq4N2tNnQkILqVWq0Rkjrr8l xUw0veluyD2BcLyGP1KRS/KanDazWSaTZRlT3tURCU1Y6qtUWOBlGPfxzhBDE7SaOmDu 3DYA== 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=SnMUtf51vqqPNjEcZrGNS6TjBcXNU2spGBBI9UEPVNg=; fh=H1AXMuko56EfY+4pMcUqDLIow0rsGAnFgbDVYODEbGY=; b=LLLsoBZzFmoEW8ta8jKT0zaCrBh6sZ8xsUCngTsaZxSTyxXYxLsv8DD4YKnp3oeEtd 7zgVXglAK0g1X7o81nh6MbVRJ2DdpHWoMhH+Ozu4rsZwemCkcbC6MZoWffVBOky63dKb 8Oo8rzNBEMBtEndEZSF2t3irdJFHTLUyKThdvDuXRJu1SrXgCqjLiENUo3+UMSAkYB6p BIxlPOx+nvUU+IfgDAgBeZ07KslE41O7RVY2hzp50s6QVu3sH5N4a6yPz+pmL7k1A/Cm vS+WKyg9cbL7lCm1tL0QWxfrypCDDiWE8ovXqFkKQmouWDWu63nQJO2/uNunG6gtDKru V15w==; 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-68519-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-68519-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id x29-20020a63b21d000000b005dbd9c28c62si2830268pge.539.2024.02.16.03.26.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Feb 2024 03:26:57 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-68519-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=sk.com); spf=pass (google.com: domain of linux-kernel+bounces-68519-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-68519-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 585BF2869FF for ; Fri, 16 Feb 2024 11:26:57 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 742C377636; Fri, 16 Feb 2024 11:26:51 +0000 (UTC) Received: from invmail4.hynix.com (exvmail4.hynix.com [166.125.252.92]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 60FA11E499 for ; Fri, 16 Feb 2024 11:26:43 +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=1708082811; cv=none; b=frIXDZHcMxlOHKsKTRXV4DU8dmVGdlW2M5ANiONvACZY24qFHaTA2SXliK6itE88pi7jRDvCLBWDKWi/oUr+m4d6EdFL9gVGGA1HXC18Nou8+PlZWK7ODKI8srp+1Bh4NhuSQBgSiZ6QVDORFdNw5U2OFj2Tx1DDJuFm78cQkYo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708082811; c=relaxed/simple; bh=r60TtNSvLpFek6w6RsdFTH0BMLv/88jRak/JmVGFlRo=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=frszLjfdcUdrobYxpUr5c17d3oEdx3doFLu/eBhxeWNudxoUa9JNbf6CKXqoCQwcKRNRx94eCvydQziQLDl5L4KfXvKtXP1MXPtWU6uU/4axWHjGBGD48OUEBaTikEc6M8mI4Q0o0Sa0X9CKgCwZBTBPXHHZGQHof7ZrKgoZq1Y= 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-3c-65cf46719aab Date: Fri, 16 Feb 2024 20:26:36 +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: <20240216112636.GA4266@system.software.com> References: <20240214035355.18335-1-byungchul@sk.com> <20240216070754.GB32626@system.software.com> <20240216091139.GA75176@system.software.com> <20240216092305.GC75176@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: <20240216092305.GC75176@system.software.com> User-Agent: Mutt/1.9.4 (2018-02-28) X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFuphkeLIzCtJLcpLzFFi42LhesuzSLfQ7XyqQVOzusWc9WvYLC49vspm Mf1lI4vF0wlbmS3u9k9lsbi8aw6bxb01/1ktJr97xmhx6cACJosz04osjvceYLLY1/GAyaLj yDdmi61Hv7M78HmsmbeG0aNl3y12jwWbSj02r9Dy2PRpErvHnWt72DxOzPjN4vF+31U2j82n qz0+b5IL4IrisklJzcksSy3St0vgyji9Kb3gFF/FjlnXmBsYl3J3MXJySAiYSOxecI0Rxp5w 7xZzFyMHB4uAqsTZZVYgYTYBdYkbN34yg9giAmoS0141sncxcnEwC5xikpjw+QI7SL2wQJjE 3zcKIDW8AuYSHWd/MYPUCAnMYJL4sm41G0RCUOLkzCcsIDazgJbEjX8vmUB6mQWkJZb/4wAx OQUsJfZs0QapEBVQljiw7TgTyBgJgWZ2iblP5rJAnCkpcXDFDZYJjAKzkEydhWTqLISpCxiZ VzEKZeaV5SZm5pjoZVTmZVboJefnbmIExtGy2j/ROxg/XQg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pArFeRRp1Z9RK+IzZH1p/89mL9tmvzdFe0aJ33jbiZomgaqfNNPfX7zCnn A+oEvfnNriVYihUXBH+ssPNNUGIpzkg01GIuKk4EABR6UqKGAgAA X-CFilter-Loop: Reflected On Fri, Feb 16, 2024 at 06:23:05PM +0900, Byungchul Park wrote: > On Fri, Feb 16, 2024 at 06:11:40PM +0900, Byungchul Park wrote: > > 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. I analyzed it wrong. Even though the issue was gone with the patch but it's not the fix. Sorry for making you confused. I submitted the fix with another patch: https://lore.kernel.org/lkml/20240216111502.79759-1-byungchul@sk.com/ Byungchul