Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp323057pxb; Thu, 27 Jan 2022 23:11:14 -0800 (PST) X-Google-Smtp-Source: ABdhPJypRvlM30MpeOV2engfYFn4yAj593PX3a8O+CHb+6FscOUhG6rp/TVZ4OqWws4+ip1kaGkf X-Received: by 2002:a05:6402:35c5:: with SMTP id z5mr3889312edc.43.1643353874565; Thu, 27 Jan 2022 23:11:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643353874; cv=none; d=google.com; s=arc-20160816; b=hxQojjvWL9/AI+R6kV3kXiQTrwIuoSGoGaXywxOMHP7SM70f1bFQUvH0P1d7j5ucuu KWB3tFnPXX7R5b3hygwhFEX3IA49yQb+aB4VtHhBdMPOwRKSbI0I2On5OSw/7+Yz2hlR EMRYwkTVbAuVZQ+JYxV3idOC3iRHCwwycK1i5lzk8mbFO2gZE2J7ued6A853zXBgyTqX Jukpjc9klXvLCUnNnQEqhkTdyJTf2Io0uvVgOjfQXOj5hfr1cY8BR8W3ViM4undwTMBR bHuBNOEKjqYmPTvuB98JBoMnhrgg3zJjOVcwkXBR2D5kz5wJwdFdv3ppeDA6TF/X9fpa ZCJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=b1fyaWkWIGrGQWy1HE0JTg/w7epm1UWuZ9515OjLrsU=; b=ID8SPhkCv3pXJtDgfZuUswj9NlBsbZhwmwZDdb+Bc114F4l0ObGo1755eE4aN3S21B s/r92MbCN3+ludqobRPx2/bDgU7TLeL2gZWOhTxazOFCSaxP8c0Utj28nWlOM75DIz0R FR8Pv9DQxt29yjidii2JmYHYKaUkLPTNyeuL40kkxsUKX8kHMMeRbgcE3Z7M5UKYCY3R dBzdflhpu4OhQLmsLEqMeqby9plOfju9G4fj3gj+6Ii/AMzoVsNMeioLBP/Ze+Y8nzJ5 XEcVKcUrJWibns8ldkFd9a7KPkxou8sXv4tBMH4crQGw5lSq3wWWuZ9i5DNKMZZ4irkR iE9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=G7X07oQ9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id nc19si2602235ejc.670.2022.01.27.23.10.49; Thu, 27 Jan 2022 23:11:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=G7X07oQ9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242763AbiA0PE3 (ORCPT + 99 others); Thu, 27 Jan 2022 10:04:29 -0500 Received: from ams.source.kernel.org ([145.40.68.75]:38924 "EHLO ams.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233428AbiA0PE1 (ORCPT ); Thu, 27 Jan 2022 10:04:27 -0500 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 9251BB8226E for ; Thu, 27 Jan 2022 15:04:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id F060EC340E4; Thu, 27 Jan 2022 15:04:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1643295864; bh=4DDJ0R0l0lKF3t9F9nLmdfprQlVOrocx1zdesDaL97A=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=G7X07oQ9duTQ02ktflfQEnrcwx6le8k6+d2Zaea8O/aL1Eqqc1VwveDX3f4HGbFAj XBUcaoZyRzH03Y5YRP0U0ujMPVnPtzrC/Ya563DyQ9I49ePH2qwn2Ue4eE1GSR0mtf rLHQgkrPAuAtCzFXtjMZ8RXvE2/5MDjel15nAEOy97gkitJciePEHJGFjLwcABOabb T06tUl47mrD5HTWGG9R2hpAadbjglBAktrZwXeDYRlWPlZDe+g+MpkLXkiFuPnSBWd 24Nwd6iWJG55ylmkP6aZZb17cpLDABEYL9i+Bn5/ELxsfyd3Xw2nV29HQtf1Rf4J06 MtlJqOqO+77dQ== Date: Thu, 27 Jan 2022 17:04:14 +0200 From: Mike Rapoport To: Michal Hocko Cc: Andrew Morton , linux-mm@kvack.org, LKML , David Hildenbrand , Alexey Makhalov , Dennis Zhou , Eric Dumazet , Oscar Salvador , Tejun Heo , Christoph Lameter , Nico Pache , Wei Yang , 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jan 27, 2022 at 03:47:40PM +0100, Michal Hocko wrote: > On Thu 27-01-22 15:37:23, Mike Rapoport wrote: > > On Thu, Jan 27, 2022 at 09:53:01AM +0100, Michal Hocko wrote: > [...] > > > + if (!node_online(nid)) { > > > + pr_warn("Node %d uninitialized by the platform. Please report with boot dmesg.\n", nid); > > > > Do we assume that platform code must allocate node data for all nodes in > > the system? Because if we don't this warning is misleading. > > At least x86 does that (init_cpu_to_node). Now that you brought that up > I guess you are right that this could be more misleading than helpful. I'm not sure if other architectures allocate memoryless nodes, but for sure only x86 initializes it with free_area_init_memoryless_node(). > What about > pr_info("Initializing node %d as memoryless\n", nid); > Is this better? I think yes. > > > + > > > + /* Allocator not initialized yet */ > > > + pgdat = arch_alloc_nodedata(nid); > > > + if (!pgdat) { > > > + pr_err("Cannot allocate %zuB for node %d.\n", > > > + sizeof(*pgdat), nid); > > > + continue; > > > + } > > > + arch_refresh_nodedata(nid, pgdat); > > > + free_area_init_memoryless_node(nid); > > > + /* > > > + * 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 > > > + */ > > > + continue; > > > > This can be made slightly more concise if we fall through after > > arch_refresh_nodedata(), e.g. something like > > > > ... > > > > arch_refresh_nodedata(nid, pgdat); > > } > > > > pgdat = NODE_DATA(nid); > > free_area_init_node(nid); > > > > /* > > * Do not mark memoryless 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 > > */ > > if (!pgdat->node_present_pages) > > continue; > > > > but I don't feel strongly about it. > > I do not have strong preference either way. Unless this is considered > better by more people I would stick with what I have. > -- > Michal Hocko > SUSE Labs -- Sincerely yours, Mike.