Merge branch 'x86/urgent' into x86-mm
Merge reason: Pick up the following two fix commits.2be19102b7
: x86, NUMA: Fix empty memblk detection in numa_cleanup_meminfo()765af22da8
: x86-32, NUMA: Fix ACPI NUMA init broken by recent x86-64 change Scheduled NUMA init 32/64bit unification changes depend on these. Signed-off-by: Tejun Heo <tj@kernel.org>
This commit is contained in:
@@ -213,53 +213,48 @@ int early_cpu_to_node(int cpu)
|
||||
return per_cpu(x86_cpu_to_node_map, cpu);
|
||||
}
|
||||
|
||||
struct cpumask __cpuinit *debug_cpumask_set_cpu(int cpu, int enable)
|
||||
void debug_cpumask_set_cpu(int cpu, int node, bool enable)
|
||||
{
|
||||
int node = early_cpu_to_node(cpu);
|
||||
struct cpumask *mask;
|
||||
char buf[64];
|
||||
|
||||
if (node == NUMA_NO_NODE) {
|
||||
/* early_cpu_to_node() already emits a warning and trace */
|
||||
return NULL;
|
||||
return;
|
||||
}
|
||||
mask = node_to_cpumask_map[node];
|
||||
if (!mask) {
|
||||
pr_err("node_to_cpumask_map[%i] NULL\n", node);
|
||||
dump_stack();
|
||||
return NULL;
|
||||
}
|
||||
|
||||
cpulist_scnprintf(buf, sizeof(buf), mask);
|
||||
printk(KERN_DEBUG "%s cpu %d node %d: mask now %s\n",
|
||||
enable ? "numa_add_cpu" : "numa_remove_cpu",
|
||||
cpu, node, buf);
|
||||
return mask;
|
||||
}
|
||||
|
||||
# ifndef CONFIG_NUMA_EMU
|
||||
static void __cpuinit numa_set_cpumask(int cpu, int enable)
|
||||
{
|
||||
struct cpumask *mask;
|
||||
|
||||
mask = debug_cpumask_set_cpu(cpu, enable);
|
||||
if (!mask)
|
||||
return;
|
||||
}
|
||||
|
||||
if (enable)
|
||||
cpumask_set_cpu(cpu, mask);
|
||||
else
|
||||
cpumask_clear_cpu(cpu, mask);
|
||||
|
||||
cpulist_scnprintf(buf, sizeof(buf), mask);
|
||||
printk(KERN_DEBUG "%s cpu %d node %d: mask now %s\n",
|
||||
enable ? "numa_add_cpu" : "numa_remove_cpu",
|
||||
cpu, node, buf);
|
||||
return;
|
||||
}
|
||||
|
||||
# ifndef CONFIG_NUMA_EMU
|
||||
static void __cpuinit numa_set_cpumask(int cpu, bool enable)
|
||||
{
|
||||
debug_cpumask_set_cpu(cpu, early_cpu_to_node(cpu), enable);
|
||||
}
|
||||
|
||||
void __cpuinit numa_add_cpu(int cpu)
|
||||
{
|
||||
numa_set_cpumask(cpu, 1);
|
||||
numa_set_cpumask(cpu, true);
|
||||
}
|
||||
|
||||
void __cpuinit numa_remove_cpu(int cpu)
|
||||
{
|
||||
numa_set_cpumask(cpu, 0);
|
||||
numa_set_cpumask(cpu, false);
|
||||
}
|
||||
# endif /* !CONFIG_NUMA_EMU */
|
||||
|
||||
|
@@ -191,7 +191,7 @@ int __init numa_cleanup_meminfo(struct numa_meminfo *mi)
|
||||
bi->end = min(bi->end, high);
|
||||
|
||||
/* and there's no empty block */
|
||||
if (bi->start == bi->end) {
|
||||
if (bi->start >= bi->end) {
|
||||
numa_remove_memblk_from(i--, mi);
|
||||
continue;
|
||||
}
|
||||
|
@@ -454,10 +454,9 @@ void __cpuinit numa_remove_cpu(int cpu)
|
||||
cpumask_clear_cpu(cpu, node_to_cpumask_map[i]);
|
||||
}
|
||||
#else /* !CONFIG_DEBUG_PER_CPU_MAPS */
|
||||
static void __cpuinit numa_set_cpumask(int cpu, int enable)
|
||||
static void __cpuinit numa_set_cpumask(int cpu, bool enable)
|
||||
{
|
||||
struct cpumask *mask;
|
||||
int nid, physnid, i;
|
||||
int nid, physnid;
|
||||
|
||||
nid = early_cpu_to_node(cpu);
|
||||
if (nid == NUMA_NO_NODE) {
|
||||
@@ -467,28 +466,21 @@ static void __cpuinit numa_set_cpumask(int cpu, int enable)
|
||||
|
||||
physnid = emu_nid_to_phys[nid];
|
||||
|
||||
for_each_online_node(i) {
|
||||
for_each_online_node(nid) {
|
||||
if (emu_nid_to_phys[nid] != physnid)
|
||||
continue;
|
||||
|
||||
mask = debug_cpumask_set_cpu(cpu, enable);
|
||||
if (!mask)
|
||||
return;
|
||||
|
||||
if (enable)
|
||||
cpumask_set_cpu(cpu, mask);
|
||||
else
|
||||
cpumask_clear_cpu(cpu, mask);
|
||||
debug_cpumask_set_cpu(cpu, nid, enable);
|
||||
}
|
||||
}
|
||||
|
||||
void __cpuinit numa_add_cpu(int cpu)
|
||||
{
|
||||
numa_set_cpumask(cpu, 1);
|
||||
numa_set_cpumask(cpu, true);
|
||||
}
|
||||
|
||||
void __cpuinit numa_remove_cpu(int cpu)
|
||||
{
|
||||
numa_set_cpumask(cpu, 0);
|
||||
numa_set_cpumask(cpu, false);
|
||||
}
|
||||
#endif /* !CONFIG_DEBUG_PER_CPU_MAPS */
|
||||
|
@@ -211,10 +211,12 @@ int __init get_memcfg_from_srat(void)
|
||||
{
|
||||
int i, j, nid;
|
||||
|
||||
|
||||
if (srat_disabled())
|
||||
goto out_fail;
|
||||
|
||||
if (acpi_numa_init() < 0)
|
||||
goto out_fail;
|
||||
|
||||
if (num_memory_chunks == 0) {
|
||||
printk(KERN_DEBUG
|
||||
"could not find any ACPI SRAT memory areas.\n");
|
||||
|
Verwijs in nieuw issue
Block a user