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

Commit 4fb3c9a2 authored by Junjie Wu's avatar Junjie Wu
Browse files

cpufreq: interactive: Ignore hispeed_freq logic for notification



When governor gets a notification from scheduler, scheduler provides
exact load that is required by the workload. Ignore hispeed_freq logic
and directly use choose_freq result for notifications.

Also use is_notif field to distinguish notifications instead of
MAX_LOCAL_LOAD.

Change-Id: I409ea66c00f4277adf32d18c339631e1a8b0f97b
Signed-off-by: default avatarJunjie Wu <junjiew@codeaurora.org>
parent 1d6b7340
Loading
Loading
Loading
Loading
+14 −12
Original line number Diff line number Diff line
@@ -146,8 +146,10 @@ struct cpufreq_interactive_tunables {
	 */
	unsigned int max_freq_hysteresis;

	/* Whether to change frequency immediately for notification */
	bool fast_ramp_up;
	/* Ignore hispeed_freq and above_hispeed_delay for notification */
	bool ignore_hispeed_on_notif;

	/* Ignore min_sample_time for notification */
	bool fast_ramp_down;
};

@@ -409,7 +411,6 @@ static u64 update_load(int cpu)
	return now;
}

#define MAX_LOCAL_LOAD 100
static void __cpufreq_interactive_timer(unsigned long data, bool is_notif)
{
	u64 now;
@@ -489,9 +490,10 @@ static void __cpufreq_interactive_timer(unsigned long data, bool is_notif)
	cpu_load = loadadjfreq / ppol->target_freq;
	tunables->boosted = tunables->boost_val || now < tunables->boostpulse_endtime;

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

	if ((!tunables->fast_ramp_up || cpu_load <= MAX_LOCAL_LOAD) &&
	if ((!tunables->ignore_hispeed_on_notif || !is_notif) &&
	    ppol->target_freq >= tunables->hispeed_freq &&
	    new_freq > ppol->target_freq &&
	    now - ppol->hispeed_validate_time <
@@ -936,7 +938,7 @@ 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(ignore_hispeed_on_notif);
show_store_one(fast_ramp_down);

static ssize_t show_go_hispeed_load(struct cpufreq_interactive_tunables
@@ -1330,7 +1332,7 @@ 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(ignore_hispeed_on_notif);
show_store_gov_pol_sys(fast_ramp_down);

#define gov_sys_attr_rw(_name)						\
@@ -1359,7 +1361,7 @@ 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(ignore_hispeed_on_notif);
gov_sys_pol_attr_rw(fast_ramp_down);

static struct global_attr boostpulse_gov_sys =
@@ -1385,7 +1387,7 @@ 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,
	&ignore_hispeed_on_notif_gov_sys.attr,
	&fast_ramp_down_gov_sys.attr,
	NULL,
};
@@ -1412,7 +1414,7 @@ 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,
	&ignore_hispeed_on_notif_gov_pol.attr,
	&fast_ramp_down_gov_pol.attr,
	NULL,
};