Skip to content

Commit

Permalink
cpu/hotplug: Remove dependancy against cpu_primary_thread_mask
Browse files Browse the repository at this point in the history
The commit 18415f3 ("cpu/hotplug: Allow "parallel" bringup up to
CPUHP_BP_KICK_AP_STATE") introduce a dependancy against a global variable
cpu_primary_thread_mask exported by the X86 code. This variable is only
used when CONFIG_HOTPLUG_PARALLEL is set.

Since cpuhp_get_primary_thread_mask() and cpuhp_smt_aware() are only used
when CONFIG_HOTPLUG_PARALLEL is set, don't define them when it is not set.

No functional change.

Signed-off-by: Laurent Dufour <ldufour@linux.ibm.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Tested-by: Zhang Rui <rui.zhang@intel.com>
Link: https://lore.kernel.org/r/20230705145143.40545-2-ldufour@linux.ibm.com
  • Loading branch information
ldu4 authored and KAGA-KOKO committed Jul 28, 2023
1 parent 6eaae19 commit 7a4dcb4
Showing 1 changed file with 10 additions and 14 deletions.
24 changes: 10 additions & 14 deletions kernel/cpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -650,22 +650,8 @@ bool cpu_smt_possible(void)
}
EXPORT_SYMBOL_GPL(cpu_smt_possible);

static inline bool cpuhp_smt_aware(void)
{
return topology_smt_supported();
}

static inline const struct cpumask *cpuhp_get_primary_thread_mask(void)
{
return cpu_primary_thread_mask;
}
#else
static inline bool cpu_smt_allowed(unsigned int cpu) { return true; }
static inline bool cpuhp_smt_aware(void) { return false; }
static inline const struct cpumask *cpuhp_get_primary_thread_mask(void)
{
return cpu_present_mask;
}
#endif

static inline enum cpuhp_state
Expand Down Expand Up @@ -1793,6 +1779,16 @@ static int __init parallel_bringup_parse_param(char *arg)
}
early_param("cpuhp.parallel", parallel_bringup_parse_param);

static inline bool cpuhp_smt_aware(void)
{
return topology_smt_supported();
}

static inline const struct cpumask *cpuhp_get_primary_thread_mask(void)
{
return cpu_primary_thread_mask;
}

/*
* On architectures which have enabled parallel bringup this invokes all BP
* prepare states for each of the to be onlined APs first. The last state
Expand Down

0 comments on commit 7a4dcb4

Please sign in to comment.