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 E8C54C433F5 for ; Fri, 4 Feb 2022 22:54:12 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 50C2E6B0072; Fri, 4 Feb 2022 17:54:12 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 493576B0073; Fri, 4 Feb 2022 17:54:12 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3339F6B0074; Fri, 4 Feb 2022 17:54:12 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0132.hostedemail.com [216.40.44.132]) by kanga.kvack.org (Postfix) with ESMTP id 20B6A6B0072 for ; Fri, 4 Feb 2022 17:54:12 -0500 (EST) Received: from smtpin12.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id CCB2380EA457 for ; Fri, 4 Feb 2022 22:54:11 +0000 (UTC) X-FDA: 79106602302.12.93D6829 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by imf27.hostedemail.com (Postfix) with ESMTP id 5875A40003 for ; Fri, 4 Feb 2022 22:54:11 +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 71EFCB83910; Fri, 4 Feb 2022 22:54:09 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CC487C004E1; Fri, 4 Feb 2022 22:54:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1644015248; bh=FMqUl3+T/6TQy2UFloZ92sPUyidlI+1aclHeNhJbKq0=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=Dl4lhUPI82W/mGfvO5IOe92HmKMiwEwhBnvpoAxBzjUtw11b7qg+LxFnQtiSknQm0 75AffvOzgTava/+uSWhbj2MG9e8SCzrHgqiFrKKg/9tOHJE2zHqTXvuAoEBqGB9g59 qKSY6n8Tt7NnwR1t1EHXIw84GCs7wj8b+Hl5d3Vs= Date: Fri, 4 Feb 2022 14:54:07 -0800 From: Andrew Morton To: Michal Hocko Cc: Mike Rapoport , Wei Yang , linux-mm@kvack.org, LKML , David Hildenbrand , Alexey Makhalov , Dennis Zhou , Eric Dumazet , Oscar Salvador , Tejun Heo , Christoph Lameter , Nico Pache , Rafael Aquini Subject: Re: [PATCH 2/6] mm: handle uninitialized numa nodes gracefully Message-Id: <20220204145407.c32a405fd7e8dc281993e1aa@linux-foundation.org> In-Reply-To: References: <20220127085305.20890-1-mhocko@kernel.org> <20220127085305.20890-3-mhocko@kernel.org> <20220201024119.2ailcw4rp5thambz@master> <20220203002116.akpk5um5nkpeflve@master> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Stat-Signature: w9ss95x31zs4k3mjxhe6zmmuweasrepz X-Rspam-User: nil Authentication-Results: imf27.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=Dl4lhUPI; spf=pass (imf27.hostedemail.com: domain of akpm@linux-foundation.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org; dmarc=none X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: 5875A40003 X-HE-Tag: 1644015251-934031 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, 3 Feb 2022 09:39:32 +0100 Michal Hocko wrote: > > I shuffled the words a bit, maybe this sounds better not only to me :) > > > > /* > > * We do not want to confuse userspace by sysfs files/directories for node > > * without any memory attached to it, so this node is not marked as > > * N_MEMORY and not marked online so that topology_init() won't create > > * sysfs hierarchy for this node. The pgdat will get fully initialized by > > * hotadd_init_pgdat() when memory is hotpluged into this node > > */ > > Yes, I like this comment more than mine. Andrew could you replace it in > your tree or should I repost the patch? I did this. --- a/mm/page_alloc.c~mm-handle-uninitialized-numa-nodes-gracefully-fix +++ a/mm/page_alloc.c @@ -8155,12 +8155,16 @@ void __init free_area_init(unsigned long } 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 + * We do not want to confuse userspace by sysfs + * files/directories for node without any memory + * attached to it, so this node is not marked as + * N_MEMORY and not marked online so that no sysfs + * hierarchy will be created via register_one_node for + * it. The pgdat will get fully initialized by + * hotadd_init_pgdat() when memory is hotplugged into + * this node. */ continue; } _