提交 31b46035 编写于 作者: S Sudeep Holla 提交者: Will Deacon

arm64: topology: refactor reset_cpu_topology to add support for removing topology

Currently reset_cpu_topology clears all the CPU topology information
and resets to default values. However we may need to just clear the
information when we hotplug out the CPU. In preparation to add the
support the same, let's refactor reset_cpu_topology to just reset
the information and move clearing out the topology information to
clear_cpu_topology.

Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Tested-by: NGanapatrao Kulkarni <ganapatrao.kulkarni@cavium.com>
Tested-by: NHanjun Guo <hanjun.guo@linaro.org>
Signed-off-by: NSudeep Holla <sudeep.holla@arm.com>
Signed-off-by: NWill Deacon <will.deacon@arm.com>
上级 178909a6
...@@ -293,6 +293,19 @@ void store_cpu_topology(unsigned int cpuid) ...@@ -293,6 +293,19 @@ void store_cpu_topology(unsigned int cpuid)
update_siblings_masks(cpuid); update_siblings_masks(cpuid);
} }
static void clear_cpu_topology(int cpu)
{
struct cpu_topology *cpu_topo = &cpu_topology[cpu];
cpumask_clear(&cpu_topo->llc_siblings);
cpumask_set_cpu(cpu, &cpu_topo->llc_siblings);
cpumask_clear(&cpu_topo->core_sibling);
cpumask_set_cpu(cpu, &cpu_topo->core_sibling);
cpumask_clear(&cpu_topo->thread_sibling);
cpumask_set_cpu(cpu, &cpu_topo->thread_sibling);
}
static void __init reset_cpu_topology(void) static void __init reset_cpu_topology(void)
{ {
unsigned int cpu; unsigned int cpu;
...@@ -303,15 +316,9 @@ static void __init reset_cpu_topology(void) ...@@ -303,15 +316,9 @@ static void __init reset_cpu_topology(void)
cpu_topo->thread_id = -1; cpu_topo->thread_id = -1;
cpu_topo->core_id = 0; cpu_topo->core_id = 0;
cpu_topo->package_id = -1; cpu_topo->package_id = -1;
cpu_topo->llc_id = -1; cpu_topo->llc_id = -1;
cpumask_clear(&cpu_topo->llc_siblings);
cpumask_set_cpu(cpu, &cpu_topo->llc_siblings);
cpumask_clear(&cpu_topo->core_sibling); clear_cpu_topology(cpu);
cpumask_set_cpu(cpu, &cpu_topo->core_sibling);
cpumask_clear(&cpu_topo->thread_sibling);
cpumask_set_cpu(cpu, &cpu_topo->thread_sibling);
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册