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

Commit 0f3ff5b5 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "cpufreq: interactive: Reset floor_validate_time if busy at max for 100ms"

parents 33cc10c3 b6cd9b33
Loading
Loading
Loading
Loading
+17 −1
Original line number Diff line number Diff line
@@ -93,6 +93,9 @@ static unsigned long min_sample_time = DEFAULT_MIN_SAMPLE_TIME;
#define DEFAULT_TIMER_RATE (20 * USEC_PER_MSEC)
static unsigned long timer_rate = DEFAULT_TIMER_RATE;

/* Busy SDF parameters*/
#define MIN_BUSY_TIME (100 * USEC_PER_MSEC)

/*
 * Wait this long before raising speed above hispeed, by default a single
 * timer interval.
@@ -505,6 +508,8 @@ static void cpufreq_interactive_idle_start(void)
	struct cpufreq_interactive_cpuinfo *pcpu =
		&per_cpu(cpuinfo, smp_processor_id());
	int pending;
	int cpu = pcpu->policy->cpu;
	u64 now;

	if (!down_read_trylock(&pcpu->enable_sem))
		return;
@@ -524,8 +529,19 @@ static void cpufreq_interactive_idle_start(void)
		 * min indefinitely.  This should probably be a quirk of
		 * the CPUFreq driver.
		 */
		if (!pending)
		if (!pending) {
			cpufreq_interactive_timer_resched(pcpu);

			now = ktime_to_us(ktime_get());
			if ((pcpu->policy->cur == pcpu->policy->max) &&
				(now - pcpu->hispeed_validate_time) >
							MIN_BUSY_TIME) {
				pcpu->floor_validate_time = now;
				trace_cpufreq_interactive_idle_start(cpu,
					pcpu->target_freq, pcpu->policy->cur);
			}

		}
	}

	up_read(&pcpu->enable_sem);
+6 −0
Original line number Diff line number Diff line
@@ -34,6 +34,12 @@ DEFINE_EVENT(set, cpufreq_interactive_setspeed,
	TP_ARGS(cpu_id, targfreq, actualfreq)
);

DEFINE_EVENT(set, cpufreq_interactive_idle_start,
	TP_PROTO(u32 cpu_id, unsigned long targfreq,
	     unsigned long actualfreq),
	TP_ARGS(cpu_id, targfreq, actualfreq)
);

DECLARE_EVENT_CLASS(loadeval,
	    TP_PROTO(unsigned long cpu_id, unsigned long load,
		     unsigned long curtarg, unsigned long curactual,