Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp302461pxb; Thu, 27 Jan 2022 22:34:21 -0800 (PST) X-Google-Smtp-Source: ABdhPJzeqNsi1IV1w1a0n+IVtXUbEym8ngOLAtBAYNL+82reDle0Z77t21tzJ5TyGgKJPpRPXYa8 X-Received: by 2002:a17:906:5d16:: with SMTP id g22mr5567147ejt.753.1643351661392; Thu, 27 Jan 2022 22:34:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643351661; cv=none; d=google.com; s=arc-20160816; b=z1PuMWqfshhORUTQu6rEu6qlcvzgPKudqKK+2NBbUxgvUUOlybwo1WSEd/r3YlqXZh ueJe/vOcsA51ZAvp9rsqGjWs5GJfkBDekexMn2TOAF2audj5OoHwcQtUPNP94tKx0J1C NeMwOC5U9bn0voY7eyBtuyCeX3O2YhZsvdxXM5NKKRTt3LWp0peL/WWoHVLufpGbnUGi 7nW9mEcLQPEylzfUHIXiTG8lpXr+/nRBXCMy+5oKfMZoeYcXk3XrifWB/dnZBjxfUVLZ RVCjzzH1DS2Oui9H21i/JUt53LcNefh7/fMaw+Y18BG6HEqfny4ppJEfgtGP67+tc12a WTdA== 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=rSZXlPUAg0bB3OUoojAw9hk6oWvh6DbdoWJhKR5STeg=; b=VRofO+xjywBk+SJ2Vk+u7x9BDFIQdLmLwn5TWb9jVj1wgtY5/0I7tLYxYVMLgihD9W S2ZtxtVt/mp/eUIUgHJa/ExpYJpEdnSAQSpZQKPbjKb2rTbTmhu4yhWsaI5bfAEK3+Ah unn7AR6+sHJG5dQKhV1RQEXROLMVeQdn9/hkZkaOjQ4IEHNUygi8hIOz43daNWNEgcA6 X0aUkrzwNGQ9T1GTxB2G/dMQ8YQLjPUYs2ENN9mVmUsQFa81RUzG4izu2/snnaibbP4/ ZRI7O/9E+SsSckDu6paSGR29tt7zAMZ0AzC8HX9jJcBOMrbXReW+aqcNccBwAKbJCkAO WsIw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=pRdcL1Mn; 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=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f6si2535180edc.483.2022.01.27.22.33.57; Thu, 27 Jan 2022 22:34:21 -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=@suse.com header.s=susede1 header.b=pRdcL1Mn; 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=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238115AbiA0Orr (ORCPT + 99 others); Thu, 27 Jan 2022 09:47:47 -0500 Received: from smtp-out1.suse.de ([195.135.220.28]:37714 "EHLO smtp-out1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231771AbiA0Orl (ORCPT ); Thu, 27 Jan 2022 09:47:41 -0500 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: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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