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 93A1EC433F5 for ; Thu, 27 Jan 2022 14:47:43 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 23D7D6B0095; Thu, 27 Jan 2022 09:47:43 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 1ECFC6B009A; Thu, 27 Jan 2022 09:47:43 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0DD576B009B; Thu, 27 Jan 2022 09:47:43 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0048.hostedemail.com [216.40.44.48]) by kanga.kvack.org (Postfix) with ESMTP id 0220C6B0095 for ; Thu, 27 Jan 2022 09:47:42 -0500 (EST) Received: from smtpin29.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id B72F893D6D for ; Thu, 27 Jan 2022 14:47:42 +0000 (UTC) X-FDA: 79076345964.29.CE66D35 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by imf18.hostedemail.com (Postfix) with ESMTP id 55A231C0005 for ; Thu, 27 Jan 2022 14:47:41 +0000 (UTC) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id B12DB218DF; Thu, 27 Jan 2022 14:47:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1643294860; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=rSZXlPUAg0bB3OUoojAw9hk6oWvh6DbdoWJhKR5STeg=; b=pRdcL1MnuYNVCZWQs+757C++tyO0P0QrDz+ONlfGicyCU2R2lMWDr4+4aV1xAZ6YXfSNfg FnKA78GE/ESll7AwJ4/dQeSRO5Unho1sqjtnXi4axdW3y3dO/qDROx6DNEh4CmiIyFmmwm 2fzeaKHI8Q5CynvsA7enp6x4HQSc28U= Received: from suse.cz (unknown [10.100.201.86]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id 7F612A3B84; Thu, 27 Jan 2022 14:47:40 +0000 (UTC) Date: Thu, 27 Jan 2022 15:47:40 +0100 From: Michal Hocko To: Mike Rapoport 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-Stat-Signature: yyggmbgyja9kinnpduwiow5one4nhnez X-Rspam-User: nil Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=suse.com header.s=susede1 header.b=pRdcL1Mn; spf=pass (imf18.hostedemail.com: domain of mhocko@suse.com designates 195.135.220.28 as permitted sender) smtp.mailfrom=mhocko@suse.com; dmarc=pass (policy=quarantine) header.from=suse.com X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 55A231C0005 X-HE-Tag: 1643294861-163977 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 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. What about pr_info("Initializing node %d as memoryless\n", nid); Is this better? > > + > > + /* 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