Forward port
23175351 to UEK4
The sysfs file /sys/devices/system/node/node0/cpulist is incorrect in the
single node case on sun4v machines as the machine description record in this
case does not contain any NUMA information. A default list from 0 to NR_CPUS
was used prior. This file is read by utilities such as 'numactl --hardware'
and lscpu to show CPU-to-node assignment.
In order to fix this issue, the numa_cpumask_lookup_table is cleared at
bootup. Whenever an extra cpu is bringup via __cpu_up, the corresponding
cpu mask is set in the numa_cpumask_lookup_table.
Orabug:
24500614
Orabug:
22546851
Signed-off-by: Chris Hyser <chris.hyser@oracle.com>
Signed-off-by: Thomas Tai <thomas.tai@oracle.com>
}
#endif
+void sparc64_update_numa_mask(unsigned int cpu);
+
#endif
if (tlb_type != hypervisor)
smp_synchronize_one_tick(cpu);
cpu_map_rebuild();
+ sparc64_update_numa_mask(cpu);
}
}
return ret;
for (i = 0; i < NR_CPUS; i++)
numa_cpu_lookup_table[i] = 0;
- cpumask_setall(&numa_cpumask_lookup_table[0]);
+ /* Add current cpu into numa_cpumask_lookup_table[0],
+ * the rest of the numa cpumask will be set in __cpu_up().
+ */
+ cpumask_set_cpu(smp_processor_id(), &numa_cpumask_lookup_table[0]);
#endif
}
return err;
}
+void sparc64_update_numa_mask(unsigned int cpu)
+{
+ if (num_node_masks > 1)
+ return;
+
+ cpumask_set_cpu(cpu, &numa_cpumask_lookup_table[0]);
+}
#else
static int bootmem_init_numa(void)
return -1;
}
+void sparc64_update_numa_mask(unsigned int cpu)
+{
+}
+
#endif
static void __init bootmem_init_nonnuma(void)