Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp5520165pxb; Mon, 7 Feb 2022 04:03:34 -0800 (PST) X-Google-Smtp-Source: ABdhPJwYPK54C5Z6nFa+mWXVGSywCGo09fO2dmAoPkbKGQniaptYMhVja2qWq2n+LuaSXB+/7DTY X-Received: by 2002:a17:903:1ce:: with SMTP id e14mr15511346plh.138.1644235413952; Mon, 07 Feb 2022 04:03:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644235413; cv=none; d=google.com; s=arc-20160816; b=HDhP1WG0enOMbF/mQFn4f0ddiyBPAHdeTNuZ2/A53SvXfSGcyWYBnjQnLgC1agvpqi Y49+B3tKvT/n301xwvKJgNOHqGPLIytawjLcCkt867B8SijhVxxKo8K79BH+eqxcucel VZz+eA2AOJgtWwJB00XVWa/T7JAPiKK0EtgEG/CJRVmPo7Umw5Xuk3+RbW6pt4YeTmNo qLxvUgQEvDe5+QtPCM0qdEqaYq2oFV8F4H0zL1BLy5w4eq1bwpGSahmQJJvI+DnNciYy NAHyjkfR8d9bITP9HfmAvXdFS8Od+RClgGAxL3PR+QBes8CTlBs5MsTHrxyrLgLY+yhI fb5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=HkPI9CRT/HLCYNWd8JTSPVPQ6ckVaTPs+USx3gasPRE=; b=SLMgxU+SX9S3tjv/qr1aRqlPQ3dPiuQMq2AYoCb0YV92/mNdj52ticGHkWW1hlYhI2 ksJKqsCbjZxNuB5Wmf2fjx8pv2oFIETQ3lxmVd9F+s/4jYsnNFxHk2bQpgHSjBP6icFg Xp9UtB0j6CIZQkshcrdTD8BxsYwzU43HRhtMMW4P6uBrbqo+dlTUj2G2QmSzkTt2c+KC Vpye1eIR7bOZysM2GvPFAcAm5gNNr9Wg5F59bXNFBlTSxTtxUMeZh5Rzjp0H5jjklx4X 6aRZ6bZL9jhaD6ZaTWu1rJvREm1WM/EXRiS6cpY5mjBIjzut6weCdLMsDwdLNOuBcyV6 g2Sw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=Dl4lhUPI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s190si9244260pgs.76.2022.02.07.04.03.19; Mon, 07 Feb 2022 04:03:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=Dl4lhUPI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1354442AbiBDWyO (ORCPT + 99 others); Fri, 4 Feb 2022 17:54:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60702 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1353907AbiBDWyL (ORCPT ); Fri, 4 Feb 2022 17:54:11 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 49C6CC06134A for ; Fri, 4 Feb 2022 14:54:09 -0800 (PST) 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 dfw.source.kernel.org (Postfix) with ESMTPS id DFD2F61AC3 for ; Fri, 4 Feb 2022 22:54:08 +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-Spam-Status: No, score=-5.7 required=5.0 tests=BAYES_05,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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; } _