Re: [PATCH v2 3/3] mm/page_alloc: Keep memoryless cpuless node 0 offline
From: Michal Hocko
Date: Wed Apr 29 2020 - 08:22:18 EST
On Wed 29-04-20 07:11:45, Srikar Dronamraju wrote:
> > >
> > > By marking, N_ONLINE as NODE_MASK_NONE, lets stop assuming that Node 0 is
> > > always online.
> > >
> > > ...
> > >
> > > --- a/mm/page_alloc.c
> > > +++ b/mm/page_alloc.c
> > > @@ -116,8 +116,10 @@ EXPORT_SYMBOL(latent_entropy);
> > > */
> > > nodemask_t node_states[NR_NODE_STATES] __read_mostly = {
> > > [N_POSSIBLE] = NODE_MASK_ALL,
> > > +#ifdef CONFIG_NUMA
> > > + [N_ONLINE] = NODE_MASK_NONE,
> > > +#else
> > > [N_ONLINE] = { { [0] = 1UL } },
> > > -#ifndef CONFIG_NUMA
> > > [N_NORMAL_MEMORY] = { { [0] = 1UL } },
> > > #ifdef CONFIG_HIGHMEM
> > > [N_HIGH_MEMORY] = { { [0] = 1UL } },
> >
> > So on all other NUMA machines, when does node 0 get marked online?
> >
> > This change means that for some time during boot, such machines will
> > now be running with node 0 marked as offline. What are the
> > implications of this? Will something break?
>
> Till the nodes are detected, marking Node 0 as online tends to be redundant.
> Because the system doesn't know if its a NUMA or a non-NUMA system.
> Once we detect the nodes, we online them immediately. Hence I don't see any
> side-effects or negative implications of this change.
>
> However if I am missing anything, please do let me know.
>
> >From my part, I have tested this on
> 1. Non-NUMA Single node but CPUs and memory coming from zero node.
> 2. Non-NUMA Single node but CPUs and memory coming from non-zero node.
> 3. NUMA Multi node but with CPUs and memory from node 0.
> 4. NUMA Multi node but with no CPUs and memory from node 0.
Have you tested on something else than ppc? Each arch does the NUMA
setup separately and this is a big mess. E.g. x86 marks even memory less
nodes (see init_memory_less_node) as online.
Honestly I have hard time to evaluate the effect of this patch. It makes
some sense to assume all nodes offline before they get online but this
is a land mine territory.
I am also not sure what kind of problem this is going to address. You
have mentioned numa balancing without many details.
--
Michal Hocko
SUSE Labs