Message ID | 20200318072810.9735-5-srikar@linux.vnet.ibm.com (mailing list archive) |
---|---|
State | Not Applicable |
Headers | show |
Series | Fix kmalloc_node on offline nodes | expand |
Context | Check | Description |
---|---|---|
snowpatch_ozlabs/apply_patch | success | Successfully applied on branch powerpc/merge (8a445cbcb9f5090cb07ec6cbb89a8a1fc99a0ff7) |
snowpatch_ozlabs/build-ppc64le | fail | build failed! |
snowpatch_ozlabs/build-ppc64be | fail | build failed! |
snowpatch_ozlabs/build-ppc64e | fail | build failed! |
snowpatch_ozlabs/build-pmac32 | fail | build failed! |
snowpatch_ozlabs/checkpatch | success | total: 0 errors, 0 warnings, 0 checks, 35 lines checked |
snowpatch_ozlabs/needsstable | success | Patch has no Fixes tags |
diff --git a/arch/powerpc/include/asm/topology.h b/arch/powerpc/include/asm/topology.h index 2db7ba789720..baa89364197c 100644 --- a/arch/powerpc/include/asm/topology.h +++ b/arch/powerpc/include/asm/topology.h @@ -62,6 +62,21 @@ static inline int early_cpu_to_node(int cpu) */ return (nid < 0) ? 0 : nid; } + +static inline int update_default_numa_mem(void) +{ + unsigned int node; + + for_each_node(node) { + /* + * For all possible but not yet online nodes, ensure their + * node_numa_mem is set correctly so that kmalloc_node works + * for such nodes. + */ + if (!node_online(node)) + reset_numa_mem(node); + } +} #else static inline int early_cpu_to_node(int cpu) { return 0; } @@ -90,6 +105,7 @@ static inline int cpu_distance(__be32 *cpu1_assoc, __be32 *cpu2_assoc) return 0; } +static inline int update_default_numa_mem(void) {} #endif /* CONFIG_NUMA */ #if defined(CONFIG_NUMA) && defined(CONFIG_PPC_SPLPAR) diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c index 37c12e3bab9e..d23faa70ea2d 100644 --- a/arch/powerpc/kernel/smp.c +++ b/arch/powerpc/kernel/smp.c @@ -1383,6 +1383,7 @@ void __init smp_cpus_done(unsigned int max_cpus) if (smp_ops && smp_ops->bringup_done) smp_ops->bringup_done(); + update_default_numa_mem(); dump_numa_cpu_topology(); #ifdef CONFIG_SCHED_SMT