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

Commit bf10decc authored by Lina Iyer's avatar Lina Iyer
Browse files

drivers: cpuidle: lpm-levels: plug in cpu bias



Fill in the function is_cpu_biased() with actual data from the
scheduler.

Change-Id: I5a9a9181b0e7e61d0bd7d3b0d87a93762c4c217d
Signed-off-by: default avatarLina Iyer <ilina@codeaurora.org>
parent 144b00cf
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -28,6 +28,7 @@
#include <linux/cpu_pm.h>
#include <linux/cpuhotplug.h>
#include <linux/sched/clock.h>
#include <linux/sched/stat.h>
#include <soc/qcom/pm.h>
#include <soc/qcom/event_timer.h>
#include <soc/qcom/lpm_levels.h>
@@ -573,7 +574,13 @@ static void update_history(struct cpuidle_device *dev, int idx);

static inline bool is_cpu_biased(int cpu)
{
	u64 now = sched_clock();
	u64 last = sched_get_cpu_last_busy_time(cpu);

	if (!last)
		return false;

	return (now - last) < BIAS_HYST;
}

static inline bool lpm_disallowed(s64 sleep_us, int cpu)