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

Commit 48f7a945 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: Remove sampling_down_factor"

parents 22dcb784 a3d30e3a
Loading
Loading
Loading
Loading
+3 −51
Original line number Diff line number Diff line
@@ -69,10 +69,6 @@ static struct mutex gov_lock;
static unsigned int default_target_loads[] = {DEFAULT_TARGET_LOAD};

#define DEFAULT_TIMER_RATE (20 * USEC_PER_MSEC)

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

#define DEFAULT_ABOVE_HISPEED_DELAY DEFAULT_TIMER_RATE
static unsigned int default_above_hispeed_delay[] = {
	DEFAULT_ABOVE_HISPEED_DELAY };
@@ -118,9 +114,6 @@ struct cpufreq_interactive_tunables {
#define DEFAULT_TIMER_SLACK (4 * DEFAULT_TIMER_RATE)
	int timer_slack_val;
	bool io_is_busy;

	/* Sampling down factor to be applied to min_sample_time at max freq */
	unsigned int sampling_down_factor;
};

/* For cases where we have single governor instance for system */
@@ -355,7 +348,6 @@ static void cpufreq_interactive_timer(unsigned long data)
	unsigned int index;
	unsigned long flags;
	bool boosted;
	unsigned long mod_min_sample_time;

	if (!down_read_trylock(&pcpu->enable_sem))
		return;
@@ -416,14 +408,9 @@ static void cpufreq_interactive_timer(unsigned long data)
	 * 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 (tunables->sampling_down_factor &&
	    pcpu->policy->cur == pcpu->policy->max)
		mod_min_sample_time = tunables->sampling_down_factor;
	else
		mod_min_sample_time = tunables->min_sample_time;

	if (new_freq < pcpu->floor_freq) {
		if (now - pcpu->floor_validate_time < mod_min_sample_time) {
		if (now - pcpu->floor_validate_time <
				tunables->min_sample_time) {
			trace_cpufreq_interactive_notyet(
				data, cpu_load, pcpu->target_freq,
				pcpu->policy->cur, new_freq);
@@ -485,7 +472,6 @@ static void cpufreq_interactive_idle_start(void)
	struct cpufreq_interactive_cpuinfo *pcpu =
		&per_cpu(cpuinfo, smp_processor_id());
	int pending;
	u64 now;

	if (!down_read_trylock(&pcpu->enable_sem))
		return;
@@ -505,17 +491,8 @@ 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;
			}

		}
	}

	up_read(&pcpu->enable_sem);
@@ -835,27 +812,6 @@ static ssize_t store_hispeed_freq(struct cpufreq_interactive_tunables *tunables,
	return count;
}

#define show_store_one(file_name)					\
static ssize_t show_##file_name(					\
	struct cpufreq_interactive_tunables *tunables, char *buf)	\
{									\
	return snprintf(buf, PAGE_SIZE, "%u\n", tunables->file_name);	\
}									\
static ssize_t store_##file_name(					\
		struct cpufreq_interactive_tunables *tunables,		\
		const char *buf, size_t count)				\
{									\
	int ret;							\
	long unsigned int val;						\
									\
	ret = kstrtoul(buf, 0, &val);				\
	if (ret < 0)							\
		return ret;						\
	tunables->file_name = val;					\
	return count;							\
}
show_store_one(sampling_down_factor);

static ssize_t show_go_hispeed_load(struct cpufreq_interactive_tunables
		*tunables, char *buf)
{
@@ -1065,7 +1021,6 @@ show_store_gov_pol_sys(boost);
store_gov_pol_sys(boostpulse);
show_store_gov_pol_sys(boostpulse_duration);
show_store_gov_pol_sys(io_is_busy);
show_store_gov_pol_sys(sampling_down_factor);

#define gov_sys_attr_rw(_name)						\
static struct global_attr _name##_gov_sys =				\
@@ -1089,7 +1044,6 @@ gov_sys_pol_attr_rw(timer_slack);
gov_sys_pol_attr_rw(boost);
gov_sys_pol_attr_rw(boostpulse_duration);
gov_sys_pol_attr_rw(io_is_busy);
gov_sys_pol_attr_rw(sampling_down_factor);

static struct global_attr boostpulse_gov_sys =
	__ATTR(boostpulse, 0200, NULL, store_boostpulse_gov_sys);
@@ -1110,7 +1064,6 @@ static struct attribute *interactive_attributes_gov_sys[] = {
	&boostpulse_gov_sys.attr,
	&boostpulse_duration_gov_sys.attr,
	&io_is_busy_gov_sys.attr,
	&sampling_down_factor_gov_sys.attr,
	NULL,
};

@@ -1132,7 +1085,6 @@ static struct attribute *interactive_attributes_gov_pol[] = {
	&boostpulse_gov_pol.attr,
	&boostpulse_duration_gov_pol.attr,
	&io_is_busy_gov_pol.attr,
	&sampling_down_factor_gov_pol.attr,
	NULL,
};