Skip to content

Commit 97e17c0

Browse files
committed
Merge tag 'smp-core-2024-09-16' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull CPU hotplug updates from Thomas Gleixner: - Prepare the core for supporting parallel hotplug on loongarch - A small set of cleanups and enhancements * tag 'smp-core-2024-09-16' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: smp: Mark smp_prepare_boot_cpu() __init cpu: Fix W=1 build kernel-doc warning cpu/hotplug: Provide weak fallback for arch_cpuhp_init_parallel_bringup() cpu/hotplug: Make HOTPLUG_PARALLEL independent of HOTPLUG_SMT
2 parents a430d95 + 1d07085 commit 97e17c0

File tree

4 files changed

+20
-6
lines changed

4 files changed

+20
-6
lines changed

arch/mips/kernel/smp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,7 @@ void __init smp_prepare_cpus(unsigned int max_cpus)
439439
}
440440

441441
/* preload SMP state for boot cpu */
442-
void smp_prepare_boot_cpu(void)
442+
void __init smp_prepare_boot_cpu(void)
443443
{
444444
if (mp_ops->prepare_boot_cpu)
445445
mp_ops->prepare_boot_cpu();

arch/powerpc/kernel/smp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1166,7 +1166,7 @@ void __init smp_prepare_cpus(unsigned int max_cpus)
11661166
cpu_smt_set_num_threads(num_threads, threads_per_core);
11671167
}
11681168

1169-
void smp_prepare_boot_cpu(void)
1169+
void __init smp_prepare_boot_cpu(void)
11701170
{
11711171
BUG_ON(smp_processor_id() != boot_cpuid);
11721172
#ifdef CONFIG_PPC64

include/linux/smp.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ static inline void on_each_cpu_cond(smp_cond_func_t cond_func,
109109
* Architecture specific boot CPU setup. Defined as empty weak function in
110110
* init/main.c. Architectures can override it.
111111
*/
112-
void smp_prepare_boot_cpu(void);
112+
void __init smp_prepare_boot_cpu(void);
113113

114114
#ifdef CONFIG_SMP
115115

kernel/cpu.c

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1808,6 +1808,7 @@ static int __init parallel_bringup_parse_param(char *arg)
18081808
}
18091809
early_param("cpuhp.parallel", parallel_bringup_parse_param);
18101810

1811+
#ifdef CONFIG_HOTPLUG_SMT
18111812
static inline bool cpuhp_smt_aware(void)
18121813
{
18131814
return cpu_smt_max_threads > 1;
@@ -1817,6 +1818,21 @@ static inline const struct cpumask *cpuhp_get_primary_thread_mask(void)
18171818
{
18181819
return cpu_primary_thread_mask;
18191820
}
1821+
#else
1822+
static inline bool cpuhp_smt_aware(void)
1823+
{
1824+
return false;
1825+
}
1826+
static inline const struct cpumask *cpuhp_get_primary_thread_mask(void)
1827+
{
1828+
return cpu_none_mask;
1829+
}
1830+
#endif
1831+
1832+
bool __weak arch_cpuhp_init_parallel_bringup(void)
1833+
{
1834+
return true;
1835+
}
18201836

18211837
/*
18221838
* On architectures which have enabled parallel bringup this invokes all BP
@@ -2689,9 +2705,7 @@ int cpuhp_smt_disable(enum cpuhp_smt_control ctrlval)
26892705
return ret;
26902706
}
26912707

2692-
/**
2693-
* Check if the core a CPU belongs to is online
2694-
*/
2708+
/* Check if the core a CPU belongs to is online */
26952709
#if !defined(topology_is_core_online)
26962710
static inline bool topology_is_core_online(unsigned int cpu)
26972711
{

0 commit comments

Comments
 (0)