
driver inclusion category: cleanup bugzilla: https://gitee.com/openeuler/kernel/issues/IBZQQR ---------------------------------------------------------------------- This reverts commit 4ee778a80dd45dbf3fa7c0b527271ec8babeae35. This reverts commit d31fbcb824a33a9035401a17bd995106a948b8c9. This reverts commit a09d9ba1682c68ae8a6986d4cd7c18caffb8cc53. This reverts commit b19938a0f75e2844e4c5093237f380e5ae23b361. This reverts commit 1243a42766a6352b4fdccde2caa5ef3ec41c49e1. Signed-off-by: Qi Xi <xiqi2@huawei.com> --- arch/arm64/Kconfig | 1 - arch/arm64/configs/defconfig | 1 - arch/arm64/kernel/topology.c | 23 ------------------ drivers/base/arch_topology.c | 45 ----------------------------------- include/linux/arch_topology.h | 13 ---------- 5 files changed, 83 deletions(-) diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index 6e3047a1e993..580cbe2f8ec6 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -235,7 +235,6 @@ config ARM64 select HAVE_KRETPROBES select HAVE_GENERIC_VDSO select HOTPLUG_CORE_SYNC_DEAD if HOTPLUG_CPU - select HOTPLUG_SMT if (SMP && HOTPLUG_CPU) select IRQ_DOMAIN select IRQ_FORCED_THREADING select KASAN_VMALLOC if KASAN diff --git a/arch/arm64/configs/defconfig b/arch/arm64/configs/defconfig index 2df5c1e3d42f..c6f35d0ce475 100644 --- a/arch/arm64/configs/defconfig +++ b/arch/arm64/configs/defconfig @@ -1593,7 +1593,6 @@ CONFIG_HISILICON_ERRATUM_162102203=y CONFIG_CPU_INSPECT=m CONFIG_CPU_INSPECTOR_ATF=m # end of CPU Inspect -CONFIG_HOTPLUG_SMT=y CONFIG_NUMA_AWARE_SPINLOCKS=y CONFIG_HISI_SOC_CACHE=m CONFIG_HISI_SOC_HHA=m diff --git a/arch/arm64/kernel/topology.c b/arch/arm64/kernel/topology.c index 6d0d54de7349..45143dfd1402 100644 --- a/arch/arm64/kernel/topology.c +++ b/arch/arm64/kernel/topology.c @@ -16,7 +16,6 @@ #include <linux/cacheinfo.h> #include <linux/init.h> #include <linux/percpu.h> -#include <linux/xarray.h> #include <asm/cpu.h> #include <asm/cputype.h> @@ -43,16 +42,11 @@ static bool __init acpi_cpu_is_threaded(int cpu) */ int __init parse_acpi_topology(void) { - int thread_num, max_smt_thread_num = 1; - struct xarray core_threads; int cpu, topology_id; - void *entry; if (acpi_disabled) return 0; - xa_init(&core_threads); - for_each_possible_cpu(cpu) { topology_id = find_acpi_cpu_topology(cpu, 0); if (topology_id < 0) @@ -62,20 +56,6 @@ int __init parse_acpi_topology(void) cpu_topology[cpu].thread_id = topology_id; topology_id = find_acpi_cpu_topology(cpu, 1); cpu_topology[cpu].core_id = topology_id; - - entry = xa_load(&core_threads, topology_id); - if (!entry) { - xa_store(&core_threads, topology_id, - xa_mk_value(1), GFP_KERNEL); - } else { - thread_num = xa_to_value(entry); - thread_num++; - xa_store(&core_threads, topology_id, - xa_mk_value(thread_num), GFP_KERNEL); - - if (thread_num > max_smt_thread_num) - max_smt_thread_num = thread_num; - } } else { cpu_topology[cpu].thread_id = -1; cpu_topology[cpu].core_id = topology_id; @@ -86,9 +66,6 @@ int __init parse_acpi_topology(void) cpu_topology[cpu].package_id = topology_id; } - topology_smt_set_num_threads(max_smt_thread_num); - - xa_destroy(&core_threads); return 0; } #endif diff --git a/drivers/base/arch_topology.c b/drivers/base/arch_topology.c index 630c59d97aef..2aa0c6425290 100644 --- a/drivers/base/arch_topology.c +++ b/drivers/base/arch_topology.c @@ -547,13 +547,6 @@ static int __init parse_core(struct device_node *core, int package_id, i++; } while (t); - /* - * We've already gotten threads number in this core, update the SMT - * threads number when necessary. - */ - if (i > topology_smt_get_num_threads()) - topology_smt_set_num_threads(i); - cpu = get_cpu_for_node(core); if (cpu >= 0) { if (!leaf) { @@ -757,36 +750,6 @@ const struct cpumask *cpu_clustergroup_mask(int cpu) return &cpu_topology[cpu].cluster_sibling; } -#ifdef CONFIG_HOTPLUG_SMT - -/* Maximum threads number per-Core */ -static unsigned int topology_smt_num_threads = 1; - -void __init topology_smt_set_num_threads(unsigned int num_threads) -{ - topology_smt_num_threads = num_threads; -} - -unsigned int __init topology_smt_get_num_threads(void) -{ - return topology_smt_num_threads; -} - -/* - * On SMT Hotplug the primary thread of the SMT won't be disabled. For x86 they - * seem to have a primary thread for special purpose. For other arthitectures - * like arm64 there's no such restriction for a primary thread, so make the - * first thread in the SMT as the primary thread. - */ -bool topology_is_primary_thread(unsigned int cpu) -{ - if (cpu == cpumask_first(topology_sibling_cpumask(cpu))) - return true; - - return false; -} -#endif - void update_siblings_masks(unsigned int cpuid) { struct cpu_topology *cpu_topo, *cpuid_topo = &cpu_topology[cpuid]; @@ -899,14 +862,6 @@ void __init init_cpu_topology(void) reset_cpu_topology(); } - /* - * By this stage we get to know whether we support SMT or not, update - * the information for the core. We don't support - * CONFIG_SMT_NUM_THREADS_DYNAMIC so make the max_threads == num_threads. - */ - cpu_smt_set_num_threads(topology_smt_get_num_threads(), - topology_smt_get_num_threads()); - for_each_possible_cpu(cpu) { ret = fetch_cache_info(cpu); if (!ret) diff --git a/include/linux/arch_topology.h b/include/linux/arch_topology.h index 14cdf5df760c..949ecdb6e956 100644 --- a/include/linux/arch_topology.h +++ b/include/linux/arch_topology.h @@ -100,19 +100,6 @@ void remove_cpu_topology(unsigned int cpuid); void reset_cpu_topology(void); int parse_acpi_topology(void); -#ifdef CONFIG_HOTPLUG_SMT -bool topology_is_primary_thread(unsigned int cpu); -void topology_smt_set_num_threads(unsigned int num_threads); -unsigned int topology_smt_get_num_threads(void); -#else -static inline bool topology_is_primary_thread(unsigned int cpu) { return false; } -static inline void topology_smt_set_num_threads(unsigned int num_threads) { } -static inline unsigned int topology_smt_get_num_threads(void) -{ - return 1; -} -#endif - void freq_inv_set_max_ratio(int cpu, u64 max_rate); #endif -- 2.33.0