[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <8f703c5f-44c7-3a96-487e-3bdf46ee41b0@intel.com>
Date: Mon, 25 Feb 2019 07:23:59 -0800
From: Dave Hansen <dave.hansen@...el.com>
To: Pingfan Liu <kernelfans@...il.com>, x86@...nel.org,
linux-mm@...ck.org
Cc: Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
"H. Peter Anvin" <hpa@...or.com>,
Dave Hansen <dave.hansen@...ux.intel.com>,
Vlastimil Babka <vbabka@...e.cz>,
Mike Rapoport <rppt@...ux.vnet.ibm.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Mel Gorman <mgorman@...e.de>,
Joonsoo Kim <iamjoonsoo.kim@....com>,
Andy Lutomirski <luto@...nel.org>,
Andi Kleen <ak@...ux.intel.com>,
Petr Tesarik <ptesarik@...e.cz>,
Michal Hocko <mhocko@...e.com>,
Stephen Rothwell <sfr@...b.auug.org.au>,
Jonathan Corbet <corbet@....net>,
Nicholas Piggin <npiggin@...il.com>,
Daniel Vacek <neelx@...hat.com>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 3/6] x86/numa: define numa_init_array() conditional on
CONFIG_NUMA
On 2/24/19 4:34 AM, Pingfan Liu wrote:
> +#ifdef CONFIG_NUMA
> /*
> * There are unfortunately some poorly designed mainboards around that
> * only connect memory to a single CPU. This breaks the 1:1 cpu->node
> @@ -618,6 +619,9 @@ static void __init numa_init_array(void)
> rr = next_node_in(rr, node_online_map);
> }
> }
> +#else
> +static void __init numa_init_array(void) {}
> +#endif
What functional effect does this #ifdef have?
Let's look at the code:
> static void __init numa_init_array(void)
> {
> int rr, i;
>
> rr = first_node(node_online_map);
> for (i = 0; i < nr_cpu_ids; i++) {
> if (early_cpu_to_node(i) != NUMA_NO_NODE)
> continue;
> numa_set_node(i, rr);
> rr = next_node_in(rr, node_online_map);
> }
> }
and "play compiler" for a bit.
The first iteration will see early_cpu_to_node(i)==1 because:
static inline int early_cpu_to_node(int cpu)
{
return 0;
}
if CONFIG_NUMA=n.
In other words, I'm not sure this patch does *anything*.
Powered by blists - more mailing lists