Received: by 2002:a05:7412:1e0b:b0:fc:a2b0:25d7 with SMTP id kr11csp933850rdb; Thu, 15 Feb 2024 23:09:41 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCX/9SDM1p9YiBU9b76IheDLWrEpxyhY5tpSNutZt/zMcx3mgwAyUlnfkzciTSmQgYGWdWoYbfo+4ye8xAcAqjuHeVWTdnGNUsvxLiqjBw== X-Google-Smtp-Source: AGHT+IF5zDcd3noPDBaydo6bo+sBrJZs/RfxqWOCHwEscHnuUkGNMzrlNJBw+TxCnluecq8bsorS X-Received: by 2002:a05:622a:1747:b0:42d:a88f:1cf6 with SMTP id l7-20020a05622a174700b0042da88f1cf6mr5422213qtk.5.1708067381518; Thu, 15 Feb 2024 23:09:41 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708067381; cv=pass; d=google.com; s=arc-20160816; b=ASJrk+mnVEeaKtdVRpa5JrUm2DIJV6FZjN7okYFoZqetoEEEuKfDaiTFRCzMsNsE0L ycNICuKOM65718jzOeLocIoufOtGZAc4AH+a6EHNZvJ1DyMcYk5WRqeHZwe3xdq9Hm1K 3ySL27dLKoJgmTeb1TKJg9MjqHXfsM+7azmhbtYVQiHDSCKowXTnMV3z4NH9uU1tjgDP itLDkJB4xo0MfA53zAMWgflwhe7IM+iqbo3fQVk9okLDlfBWiD2sSKjLKb0T0IxLuUlI BCFq2jcWxOYjSqErbD3Vhvx4qPAoMs/1xDfGbciDN2/3iGi/1dfuYLWwEUpru5jFrQpH WxiQ== 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=n8Qpc7uqFjBN2JE9Tz5SV42E0c7EK5TLkyfjJkXaRSU=; fh=H1AXMuko56EfY+4pMcUqDLIow0rsGAnFgbDVYODEbGY=; b=0CSxvbQPUbX6HHALagq/aRvPA7QCiwCsm2/0WNnGTZxTtXCEZQSG6wQHPodz2paGPY 7zpbQ5SGMpcOvX8Sh21S26YeR/Q0VuJ6tWoiuRYzfLXXuugLdmzCpORq3sw2ereUFssC BXe/8pwBpme5sEPBCHgqs505LGEMlPSKjLtDWWZyVbhvAsrYWSPOzNC5Fnsrhjn1Yp1Y YdC+ZkNy2ideEF6186GYZ8AWE3U+p6slmLtofBPlT3nZhn1o92B/NeQl9fOxlM5wHRnW SfoE5R6hKCJqzMH0fz80mKPhTrIhseyTfeGf/B0xT1m6CviTvJiDIO83K80e+qHQlNmo 1Q9Q==; 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-68155-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-68155-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id e14-20020ac845ce000000b0042c459cd209si3150023qto.600.2024.02.15.23.09.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 23:09:41 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-68155-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=sk.com); spf=pass (google.com: domain of linux-kernel+bounces-68155-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-68155-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 45A2E1C22738 for ; Fri, 16 Feb 2024 07:09:41 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EB179179B5; Fri, 16 Feb 2024 07:08:11 +0000 (UTC) Received: from invmail4.hynix.com (exvmail4.skhynix.com [166.125.252.92]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F2D8A17741 for ; Fri, 16 Feb 2024 07:08:01 +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=1708067291; cv=none; b=VfodpTHufmzsyEJcGIT1H2I1T/MAr5C04rzrl12UHuFv1DG5W1aC3c5B6BR9VSlw/i5nLKUUAsOAD7nrPgHOrPujjgU3Rbjl90X446g5R7FwV65dd5zIWru6PZzpcO3Nxj5TRURnbnYKWJQGwBotK5GUFmZuucH07kThixVGeIQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708067291; c=relaxed/simple; bh=P1JpDgi6JxDyqQ6JKwjy3OrNu+eVb8L1qNX9R+kIjls=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=YjvYIlebSV+OlK4aEu2NE/LdRAG97JDdQHvH4Ol5upCJ+t3SGZLN/gvDdfazSz2ZZebYQ0pLzpatqqmdzYDAON5Cj9l9qDLaL72RYjEcxW886MPgPjuYxsBVW88/EyBiLErZu4jxio43z/FXzAm9mKsGECxEymiQmnXhcUrvaao= 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-87-65cf09cf730f Date: Fri, 16 Feb 2024 16:07:54 +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: <20240216070754.GB32626@system.software.com> References: <20240214035355.18335-1-byungchul@sk.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+NgFuphkeLIzCtJLcpLzFFi42LhesuzSPc85/lUgzULLC3mrF/DZnHp8VU2 i+kvG1ksnk7Yymxxt38qi8XlXXPYLO6t+c9qMfndM0aLSwcWMFmcmVZkcbz3AJPFvo4HTBYd R74xW2w9+p3dgc9jzbw1jB4t+26xeyzYVOqxeYWWx6ZPk9g97lzbw+ZxYsZvFo/3+66yeWw+ Xe3xeZNcAFcUl01Kak5mWWqRvl0CV8aGS6YFG7gqjr2axNTAuImji5GTQ0LARGLqnRvMMPbN xefZQGwWAVWJF107WUBsNgF1iRs3foLViAioSUx71cjexcjFwSxwikliwucLQA4Hh7BAmMTf NwogNbwCFhKTpk8HCwsJJEjc2iIOERaUODnzCdhIZgEtiRv/XjKBlDALSEss/wd2DaeAqURj +2qwC0QFlCUObDvOBLJJQuA/m8Scxy+hzpSUOLjiBssERoFZSMbOQjJ2FsLYBYzMqxiFMvPK chMzc0z0MirzMiv0kvNzNzEC42hZ7Z/oHYyfLgQfYhTgYFTi4T3w52yqEGtiWXFl7iFGCQ5m JRHeSb1nUoV4UxIrq1KL8uOLSnN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RcObR/1tZgg8Ty0M9HlViKMxINtZiLihMBIvbnWIYCAAA= X-CFilter-Loop: Reflected On Wed, Feb 14, 2024 at 10:13:57PM +0100, Oscar Salvador wrote: > On Wed, Feb 14, 2024 at 12:53:55PM +0900, Byungchul Park wrote: > > While running qemu with a configuration where some CPUs don't have their > > local memory and with a kernel numa balancing on, the following oops has > > been observed. It's because of null pointers of ->zone_pgdat of zones of > > those nodes that are not initialized at booting time. So should avoid > > nodes not set N_MEMORY from getting promoted. > > Looking at free_area_init(), we call free_area_init_node() for each node > found on the system. > And free_area_init_node()->free_area_init_core() inits all zones > belonging to the system via zone_init_internals(). 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. Byungchul > Now, I am not saying the check is wrong because we obviously do not want > migrate memory to a memoryless node, but I am confused as to where > we are crashing. > > > -- > Oscar Salvador > SUSE Labs