Received: by 2002:a05:7412:1e0b:b0:fc:a2b0:25d7 with SMTP id kr11csp983333rdb; Fri, 16 Feb 2024 01:23:28 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXhrv18CBEK8JkBbe0wpKu9DU3YZnBW9nARTYvTuNUXmT19+DsGz4t9heqMvwoPCaaobWRZW0X6V43UGqSUhXlO2ABP5VsNqDj1V1fbPA== X-Google-Smtp-Source: AGHT+IHuNH65oYI6cr0kA0RS5p6epOe7swOV+s8KvVX1EJlKj8MDzyMWZu6S/UPHynrQ8b97emuP X-Received: by 2002:a17:907:1011:b0:a37:7f72:574c with SMTP id ox17-20020a170907101100b00a377f72574cmr3217984ejb.68.1708075408615; Fri, 16 Feb 2024 01:23:28 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708075408; cv=pass; d=google.com; s=arc-20160816; b=PrRhhgJ/FywEwHBvB8LipOV8Eb24ppcM02IJarIGTke1ZpEqrx7nlOxDPGU7Hlgn8K NaThJzUVabPmWrikJvj9b5s6JyTLtf6NRjwOZJmLowpsKtw7GmypWA5aoao/vAEo2hYj Cs5Z1+izcxcPfLsu7bUYqUrj92KuT0MjLPzHCEedZkmgXEE+i4JsEte0hPljyca1Y/2a NQmBeV+Qix06ghfdfMhRqNeWjoYCfmCrw+GV8B7FpTZWgwddst/pgG/z1/hs2DQ8vnbV v7QEqkMNf3hU4UxWA4VaxWwm2+EUWZyRTbTCxiucxI/zQyOANJTCkX4PfxJnLyTL8sZI sfkQ== 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=g4ohZB27ELYs2yMYoRfmYNVAla0kVPLN9dOQzIAaWuM=; fh=H1AXMuko56EfY+4pMcUqDLIow0rsGAnFgbDVYODEbGY=; b=b221Kb1H1pbh453Wc2W3zAB4yRZmuoH1NG2PZmOqFDbKayAEDssc+xCvHPEp6eZe+0 a9W0KoIdZ+k/qo5F5yQkGXcrirjIcmm1TO3V4gYYC6PG3gsm65o77k2vHowLy8CS+xjK Mv00+w2d/I6lr3q+UGA0CONQoGJIeJonWua8elbK6voq9NoghdpZKmfiuqxMSupMERsx LWPt0ZdwLyOaKoMOeJub4fsQKpjBt+3rscVsoo4hNTulMhIMHvRiYXZVDZQw2GfGOcrk 6Gr3PJETyyUJwZVnFrDxaKLx1cXIPySALvd5EX1L44YJQOoXa7bHW/iQR1/8H9dBu3SX iv+A==; 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-68327-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-68327-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id di11-20020a170906730b00b00a3da2af4924si1273809ejc.742.2024.02.16.01.23.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Feb 2024 01:23:28 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-68327-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=sk.com); spf=pass (google.com: domain of linux-kernel+bounces-68327-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-68327-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 609D31F23A3D for ; Fri, 16 Feb 2024 09:23:28 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 19C011BC58; Fri, 16 Feb 2024 09:23:20 +0000 (UTC) Received: from invmail4.hynix.com (exvmail4.skhynix.com [166.125.252.92]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2B34D1BC3C for ; Fri, 16 Feb 2024 09:23:11 +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=1708075399; cv=none; b=ZiEkwf0mPJJtFp1RJXqmC7G5QztWzL5W8UlSQIeMLnopH/Hw5gu02EUUiVAn2gFFEckTQVob53Lt4ZEqTf7BJ9blfYfvGYQ6mWpmQUfJ03zeFxR6IPPYEbI6CENCqoZqfuJtbKrtwmrraeGx1UrsX7pr6VjphGvlL5LWYaDaX3I= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708075399; c=relaxed/simple; bh=9SXdXn9AqvDzCkZcLX9Fytd5UYUM/pdMAgYv9JAmgtk=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=IZPsEkuz9qYiB0XPLTA1CV919Ghpl7/CSOwUgeMOdIZHoMCwLm7rrBdvRr8JsIWkXCrnu2cdngKb3ohJKBmItj92Bm68DKZLSVG9tMyaUnr+xerqZzOaS/FtwanmiAI/89X8lnLuInuTdteQEw8PhiplO+avAbbUDmpxfCkofi4= 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-d5-65cf297e427b Date: Fri, 16 Feb 2024 18:23:05 +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: <20240216092305.GC75176@system.software.com> References: <20240214035355.18335-1-byungchul@sk.com> <20240216070754.GB32626@system.software.com> <20240216091139.GA75176@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: <20240216091139.GA75176@system.software.com> User-Agent: Mutt/1.9.4 (2018-02-28) X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFupjkeLIzCtJLcpLzFFi42LhesuzSLdO83yqwYEjhhZz1q9hs7j0+Cqb xfSXjSwWTydsZba42z+VxeLyrjlsFvfW/Ge1mPzuGaPFpQMLmCzOTCuyON57gMliX8cDJouO I9+YLbYe/c7uwOexZt4aRo+WfbfYPRZsKvXYvELLY9OnSewed67tYfM4MeM3i8f7fVfZPDaf rvb4vEkugCuKyyYlNSezLLVI3y6BK2PL+odMBY95K2aunsLWwHifq4uRk0NCwERi6+8rjDD2 2xUrWLoYOThYBFQl5k6rBwmzCahL3LjxkxnEFhFQk5j2qpG9i5GLg1ngFJPEhM8X2EHqhQXC JP6+UQCp4RWwkNjzuZ0JpEZI4CWjxLopK1ghEoISJ2c+YQGxmQW0JG78e8kE0sssIC2x/B8H SJhTwFLi5o7N7CC2qICyxIFtx8HmSAi0s0tMeXOXCeJOSYmDK26wTGAUmIVk7CwkY2chjF3A yLyKUSgzryw3MTPHRC+jMi+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DdW2pUXW15EHffVdlr26oOrb+ymj/du+igrrHtXVpNyQUq6mmllNmvVXiejiOIa l491R3dkBj3iXSDeukxXap/wxAwlluKMREMt5qLiRADnLik4iAIAAA== X-CFilter-Loop: Reflected 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. > > Just in case, this patch is still definitely necessary tho. Sorry for the confusing expression. Please don't misunderstand it. The oops has been always observed in the configuration that I descriped. I meant: Just in case, I need to say the fix is still necessary. Byungchul