Re: [PATCH 2/6] mm: handle uninitialized numa nodes gracefully

From: Andrew Morton
Date: Fri Feb 04 2022 - 17:54:16 EST


On Thu, 3 Feb 2022 09:39:32 +0100 Michal Hocko <mhocko@xxxxxxxx> 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;
}
_