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

Commit b9ae0269 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: Make skipping delay for migration optional"

parents 2142ac25 dbb181f3
Loading
Loading
Loading
Loading
+20 −4
Original line number Diff line number Diff line
@@ -145,6 +145,10 @@ struct cpufreq_interactive_tunables {
	 * frequency.
	 */
	unsigned int max_freq_hysteresis;

	/* Whether to change frequency immediately for notification */
	bool fast_ramp_up;
	bool fast_ramp_down;
};

/* For cases where we have single governor instance for system */
@@ -487,7 +491,7 @@ static void __cpufreq_interactive_timer(unsigned long data, bool is_notif)

	if (cpu_load >= tunables->go_hispeed_load || tunables->boosted) {
		if (ppol->policy->cur < tunables->hispeed_freq &&
		    cpu_load <= MAX_LOCAL_LOAD) {
		    (!tunables->fast_ramp_up || cpu_load <= MAX_LOCAL_LOAD)) {
			new_freq = tunables->hispeed_freq;
		} else {
			new_freq = choose_freq(ppol, loadadjfreq);
@@ -502,7 +506,7 @@ static void __cpufreq_interactive_timer(unsigned long data, bool is_notif)
			new_freq = tunables->hispeed_freq;
	}

	if (cpu_load <= MAX_LOCAL_LOAD &&
	if ((!tunables->fast_ramp_up || cpu_load <= MAX_LOCAL_LOAD) &&
	    ppol->policy->cur >= tunables->hispeed_freq &&
	    new_freq > ppol->policy->cur &&
	    now - ppol->hispeed_validate_time <
@@ -525,7 +529,8 @@ static void __cpufreq_interactive_timer(unsigned long data, bool is_notif)

	new_freq = ppol->freq_table[index].frequency;

	if (!is_notif && new_freq < ppol->target_freq &&
	if ((!tunables->fast_ramp_down || !is_notif) &&
	    new_freq < ppol->target_freq &&
	    now - ppol->max_freq_hyst_start_time <
	    tunables->max_freq_hysteresis) {
		trace_cpufreq_interactive_notyet(max_cpu, cpu_load,
@@ -538,7 +543,8 @@ static void __cpufreq_interactive_timer(unsigned long data, bool is_notif)
	 * Do not scale below floor_freq unless we have been at or above the
	 * floor frequency for the minimum sample time since last validated.
	 */
	if (!is_notif && new_freq < ppol->floor_freq) {
	if ((!tunables->fast_ramp_down || !is_notif) &&
	    new_freq < ppol->floor_freq) {
		if (now - ppol->floor_validate_time <
				tunables->min_sample_time) {
			trace_cpufreq_interactive_notyet(
@@ -930,6 +936,8 @@ static ssize_t store_##file_name( \
}
show_store_one(max_freq_hysteresis);
show_store_one(align_windows);
show_store_one(fast_ramp_up);
show_store_one(fast_ramp_down);

static ssize_t show_go_hispeed_load(struct cpufreq_interactive_tunables
		*tunables, char *buf)
@@ -1322,6 +1330,8 @@ show_store_gov_pol_sys(use_sched_load);
show_store_gov_pol_sys(use_migration_notif);
show_store_gov_pol_sys(max_freq_hysteresis);
show_store_gov_pol_sys(align_windows);
show_store_gov_pol_sys(fast_ramp_up);
show_store_gov_pol_sys(fast_ramp_down);

#define gov_sys_attr_rw(_name)						\
static struct global_attr _name##_gov_sys =				\
@@ -1349,6 +1359,8 @@ gov_sys_pol_attr_rw(use_sched_load);
gov_sys_pol_attr_rw(use_migration_notif);
gov_sys_pol_attr_rw(max_freq_hysteresis);
gov_sys_pol_attr_rw(align_windows);
gov_sys_pol_attr_rw(fast_ramp_up);
gov_sys_pol_attr_rw(fast_ramp_down);

static struct global_attr boostpulse_gov_sys =
	__ATTR(boostpulse, 0200, NULL, store_boostpulse_gov_sys);
@@ -1373,6 +1385,8 @@ static struct attribute *interactive_attributes_gov_sys[] = {
	&use_migration_notif_gov_sys.attr,
	&max_freq_hysteresis_gov_sys.attr,
	&align_windows_gov_sys.attr,
	&fast_ramp_up_gov_sys.attr,
	&fast_ramp_down_gov_sys.attr,
	NULL,
};

@@ -1398,6 +1412,8 @@ static struct attribute *interactive_attributes_gov_pol[] = {
	&use_migration_notif_gov_pol.attr,
	&max_freq_hysteresis_gov_pol.attr,
	&align_windows_gov_pol.attr,
	&fast_ramp_up_gov_pol.attr,
	&fast_ramp_down_gov_pol.attr,
	NULL,
};