Skip to content

Commit

Permalink
ACPI/NUMA: Do not map pxm to node when NUMA is turned off
Browse files Browse the repository at this point in the history
acpi_map_pxm_to_node() unconditially maps nodes even when NUMA is turned
off. So acpi_get_node() might return a node > 0, which is fatal when NUMA
is disabled as the rest of the kernel assumes that only node 0 exists.

Expose numa_off to the acpi code and return NUMA_NO_NODE when it's set.

Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Cc: fenghua.yu@intel.com
Cc: tony.luck@intel.com
Cc: linux-ia64@vger.kernel.org
Cc: catalin.marinas@arm.com
Cc: rjw@rjwysocki.net
Cc: will.deacon@arm.com
Cc: linux-acpi@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: lenb@kernel.org
Link: http://lkml.kernel.org/r/1481602709-18260-1-git-send-email-boris.ostrovsky@oracle.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
  • Loading branch information
Boris Ostrovsky authored and Thomas Gleixner committed Dec 15, 2016
1 parent 4370a3e commit aec03f8
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 3 deletions.
2 changes: 2 additions & 0 deletions arch/arm64/include/asm/numa.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ int __node_distance(int from, int to);

extern nodemask_t numa_nodes_parsed __initdata;

extern bool numa_off;

/* Mappings between node number and cpus on that node. */
extern cpumask_var_t node_to_cpumask_map[MAX_NUMNODES];
void numa_clear_node(unsigned int cpu);
Expand Down
2 changes: 1 addition & 1 deletion arch/arm64/mm/numa.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ static int cpu_to_node_map[NR_CPUS] = { [0 ... NR_CPUS-1] = NUMA_NO_NODE };

static int numa_distance_cnt;
static u8 *numa_distance;
static bool numa_off;
bool numa_off;

static __init int numa_parse_early_param(char *opt)
{
Expand Down
2 changes: 2 additions & 0 deletions arch/ia64/include/asm/numa.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ extern int paddr_to_nid(unsigned long paddr);

#define local_nodeid (cpu_to_node_map[smp_processor_id()])

#define numa_off 0

extern void map_cpu_to_node(int cpu, int nid);
extern void unmap_cpu_from_node(int cpu, int nid);
extern void numa_clear_node(int cpu);
Expand Down
2 changes: 1 addition & 1 deletion arch/x86/mm/numa.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

#include "numa_internal.h"

int __initdata numa_off;
int numa_off;
nodemask_t numa_nodes_parsed __initdata;

struct pglist_data *node_data[MAX_NUMNODES] __read_mostly;
Expand Down
2 changes: 1 addition & 1 deletion drivers/acpi/numa.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ int acpi_map_pxm_to_node(int pxm)
{
int node;

if (pxm < 0 || pxm >= MAX_PXM_DOMAINS)
if (pxm < 0 || pxm >= MAX_PXM_DOMAINS || numa_off)
return NUMA_NO_NODE;

node = pxm_to_node_map[pxm];
Expand Down

0 comments on commit aec03f8

Please sign in to comment.