From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 09878C433EF for ; Thu, 27 Jan 2022 15:04:29 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 732B46B007E; Thu, 27 Jan 2022 10:04:28 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 6E2296B0083; Thu, 27 Jan 2022 10:04:28 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5D1CC6B0093; Thu, 27 Jan 2022 10:04:28 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0179.hostedemail.com [216.40.44.179]) by kanga.kvack.org (Postfix) with ESMTP id 5038B6B007E for ; Thu, 27 Jan 2022 10:04:28 -0500 (EST) Received: from smtpin24.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 048EA18089AA6 for ; Thu, 27 Jan 2022 15:04:28 +0000 (UTC) X-FDA: 79076388216.24.732C8DE Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by imf04.hostedemail.com (Postfix) with ESMTP id 7327040002 for ; Thu, 27 Jan 2022 15:04:27 +0000 (UTC) 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 75B4DB821EE; 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: X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 7327040002 X-Stat-Signature: e8ya57goqsx4wmscp9ukwf1uuxpsnb3h Authentication-Results: imf04.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=G7X07oQ9; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf04.hostedemail.com: domain of rppt@kernel.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=rppt@kernel.org X-Rspam-User: nil X-HE-Tag: 1643295867-788176 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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.