ANDROID: sched: add trace hook to enable EAS for SMP systems

At present, EAS gets disabled when on ASYM Capacity systems
if all BIG or Little CPUs gets hot-plugged. Instead of disabling
EAS by default, add trace hook and let vendor decide if EAS should
be disabled or not.

Bug: 176964092
Change-Id: I583272cc89d44f3e3a4b1c43e3f75d731092ebf6
Signed-off-by: Satya Durga Srinivasu Prabhala <satyap@codeaurora.org>
This commit is contained in:
Satya Durga Srinivasu Prabhala
2021-01-07 06:53:05 -08:00
committed by Todd Kjos
parent 2a715fd012
commit 598670e2d0
3 changed files with 15 additions and 2 deletions

View File

@@ -111,6 +111,7 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_sched_cpu_starting);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_sched_cpu_dying);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_account_irq);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_place_entity);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_build_perf_domains);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_update_cpu_capacity);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_update_misfit_status);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_cpu_cgroup_attach);

View File

@@ -182,6 +182,10 @@ DECLARE_RESTRICTED_HOOK(android_rvh_place_entity,
TP_PROTO(struct sched_entity *se, u64 *vruntime),
TP_ARGS(se, vruntime), 1);
DECLARE_RESTRICTED_HOOK(android_rvh_build_perf_domains,
TP_PROTO(bool *eas_check),
TP_ARGS(eas_check), 1);
DECLARE_RESTRICTED_HOOK(android_rvh_update_cpu_capacity,
TP_PROTO(int cpu, unsigned long *capacity),
TP_ARGS(cpu, capacity), 1);
@@ -239,6 +243,7 @@ DECLARE_RESTRICTED_HOOK(android_rvh_cpu_cgroup_can_attach,
#define trace_android_rvh_sched_cpu_dying(cpu)
#define trace_android_rvh_account_irq(curr, cpu, delta)
#define trace_android_rvh_place_entity(se, vruntime)
#define trace_android_rvh_build_perf_domains(eas_check)
#define trace_android_rvh_update_cpu_capacity(cpu, capacity)
#define trace_android_rvh_update_misfit_status(p, rq, need_update)
#define trace_android_rvh_cpu_cgroup_attach(tset)

View File

@@ -4,6 +4,8 @@
*/
#include "sched.h"
#include <trace/hooks/sched.h>
DEFINE_MUTEX(sched_domains_mutex);
/* Protected by sched_domains_mutex: */
@@ -348,12 +350,17 @@ static bool build_perf_domains(const struct cpumask *cpu_map)
struct perf_domain *pd = NULL, *tmp;
int cpu = cpumask_first(cpu_map);
struct root_domain *rd = cpu_rq(cpu)->rd;
bool eas_check = false;
if (!sysctl_sched_energy_aware)
goto free;
/* EAS is enabled for asymmetric CPU capacity topologies. */
if (!per_cpu(sd_asym_cpucapacity, cpu)) {
/*
* EAS is enabled for asymmetric CPU capacity topologies.
* Allow vendor to override if desired.
*/
trace_android_rvh_build_perf_domains(&eas_check);
if (!per_cpu(sd_asym_cpucapacity, cpu) && !eas_check) {
if (sched_debug()) {
pr_info("rd %*pbl: CPUs do not have asymmetric capacities\n",
cpumask_pr_args(cpu_map));