Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3a8a28a7 authored by Danny Lin's avatar Danny Lin Committed by Akshay Kakatkar
Browse files

cpumask: Add cpumask for the Prime CPU cluster



Newer Qualcomm SoCs, such as sm8150, have a Prime cluster with one CPU
core that performs better than even the big cluster.

Signed-off-by: default avatarDanny Lin <danny@kdrag0n.dev>
parent 9f009d85
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -800,6 +800,13 @@ config BIG_CPU_MASK
	  heterogeneous system. Use 0 if you are unsure, which just results in
	  this storing the bitmask of all available CPUs.

config PRIME_CPU_MASK
	int "Bitmask of available prime CPUs"
	help
	  This is a bitmask specifying which of the CPUs are prime in a
	  heterogeneous system. Use 0 if you are unsure, which just results in
	  this storing the bitmask of all available CPUs.

config HOTPLUG_CPU
	bool "Support for hot-pluggable CPUs"
	select GENERIC_IRQ_MIGRATION
+2 −0
Original line number Diff line number Diff line
@@ -57,6 +57,7 @@ extern unsigned int nr_cpu_ids;
 *     cpu_isolated_mask- has bit 'cpu' set iff cpu isolated
 *     cpu_lp_mask      - has bit 'cpu' set iff cpu is part of little cluster
 *     cpu_perf_mask    - has bit 'cpu' set iff cpu is part of big cluster
 *     cpu_perfp_mask   - has bit 'cpu' set iff cpu is part of prime cluster
 *
 *  If !CONFIG_HOTPLUG_CPU, present == possible, and active == online.
 *
@@ -103,6 +104,7 @@ extern struct cpumask __cpu_perf_mask;
#define cpu_isolated_mask ((const struct cpumask *)&__cpu_isolated_mask)
extern const struct cpumask *const cpu_lp_mask;
extern const struct cpumask *const cpu_perf_mask;
extern const struct cpumask *const cpu_perfp_mask;

#if NR_CPUS > 1
#define num_online_cpus()	cpumask_weight(cpu_online_mask)
+8 −0
Original line number Diff line number Diff line
@@ -2346,6 +2346,14 @@ const struct cpumask *const cpu_perf_mask = cpu_possible_mask;
#endif
EXPORT_SYMBOL(cpu_perf_mask);

#if CONFIG_PRIME_CPU_MASK
static const unsigned long perfp_cpu_bits = CONFIG_PRIME_CPU_MASK;
const struct cpumask *const cpu_perfp_mask = to_cpumask(&perfp_cpu_bits);
#else
const struct cpumask *const cpu_perfp_mask = cpu_possible_mask;
#endif
EXPORT_SYMBOL(cpu_perfp_mask);

void init_cpu_present(const struct cpumask *src)
{
	cpumask_copy(&__cpu_present_mask, src);