summaryrefslogtreecommitdiff
path: root/kernel/sched/sched.h
diff options
context:
space:
mode:
authorPavankumar Kondeti <pkondeti@codeaurora.org>2018-02-09 13:53:04 +0530
committerPavankumar Kondeti <pkondeti@codeaurora.org>2018-03-06 19:46:33 +0530
commit3c443961073c821ab50bc1ded0558dd7bf6aeac6 (patch)
tree9f49651513bc85ee098f4041bf6b79bf3779c97e /kernel/sched/sched.h
parenta337c17cebeadebddd57cfae9d7953567969be06 (diff)
sched: add sched_get_cpu_last_busy_time() API
sched_get_cpu_last_busy_time() returns the last time stamp when a given CPU is busy with more than 2 runnable tasks or has load greater than 50% of it's max capacity. The LPM driver can make use of this API and create a policy to prevent a recently loaded CPU entering deep sleep state. This API is implemented only for the higher capacity CPUs in the system. It returns 0 for other CPUs. Change-Id: I97ef47970a71647f4f55f21165d0cc1351770a53 Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
Diffstat (limited to 'kernel/sched/sched.h')
-rw-r--r--kernel/sched/sched.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h
index 6ef3a59612a9..255b29d5112a 100644
--- a/kernel/sched/sched.h
+++ b/kernel/sched/sched.h
@@ -1272,6 +1272,11 @@ static inline bool is_max_capacity_cpu(int cpu)
return cpu_max_possible_capacity(cpu) == max_possible_capacity;
}
+static inline bool is_min_capacity_cpu(int cpu)
+{
+ return cpu_max_possible_capacity(cpu) == min_max_possible_capacity;
+}
+
/*
* 'load' is in reference to "best cpu" at its best frequency.
* Scale that in reference to a given cpu, accounting for how bad it is