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

Commit 49fe8ea1 authored by Joonwoo Park's avatar Joonwoo Park
Browse files

sched: eliminate sched_migration_fixup knob



Kill unused scheduler knob sched_migration_fixup.  With this change
scheduler always adjusts CPU's busy time during migration.

Change-Id: I5d59e89d5cc0f2c705c40036cd7b47f5d3f89e58
Signed-off-by: default avatarJoonwoo Park <joonwoop@codeaurora.org>
parent 650cf424
Loading
Loading
Loading
Loading
+15 −26
Original line number Diff line number Diff line
@@ -972,10 +972,9 @@ TASK_MIGRATE
	SCHED_FREQ_ACCOUNT_WAIT_TIME is non-zero). After that update,
	src_cpu's curr_runnable_sum is reduced by task's curr_window value
	and dst_cpu's curr_runnable_sum is increased by task's curr_window
	value, provided sched_migration_fixup = 1. Similarly, src_cpu's
	prev_runnable_sum is reduced by task's prev_window value and dst_cpu's
	prev_runnable_sum is increased by task's prev_window value,
	provided sched_migration_fixup = 1
	value. Similarly, src_cpu's prev_runnable_sum is reduced by task's
	prev_window value and dst_cpu's prev_runnable_sum is increased by
	task's prev_window value.

IRQ_UPDATE
	This event signifies end of execution of an interrupt handler. This
@@ -1099,16 +1098,7 @@ tracking mechanism maintains per task. If default values are used for
both this and sched_ravg_window then a total of 50ms of task history
would be maintained in 5 10ms windows.

*** 7.10 sched_migration_fixup

Appears at: /proc/sys/kernel/sched_migration_fixup

Default value: 1

This controls whether a cpu's busy time counters are adjusted during task
migration.

*** 7.11 sched_freq_inc_notify
*** 7.10 sched_freq_inc_notify

Appears at: /proc/sys/kernel/sched_freq_inc_notify

@@ -1120,7 +1110,7 @@ exceeds sched_freq_inc_notify, where freq_required is the frequency calculated
by scheduler to meet current task demand. Note that sched_freq_inc_notify is
specified in kHz units.

*** 7.12 sched_freq_dec_notify
*** 7.11 sched_freq_dec_notify

Appears at: /proc/sys/kernel/sched_freq_dec_notify

@@ -1133,7 +1123,7 @@ exceeds sched_freq_dec_notify, where freq_required is the frequency calculated
by scheduler to meet current task demand. Note that sched_freq_dec_notify is
specified in kHz units.

*** 7.13 sched_heavy_task
*** 7.12 sched_heavy_task

Appears at: /proc/sys/kernel/sched_heavy_task

@@ -1145,7 +1135,7 @@ comparison. Scheduler will request a raise in cpu frequency when heavy tasks
wakeup after at least one window of sleep, where window size is defined by
sched_ravg_window. Value 0 will disable this feature.

*** 7.14 sched_cpu_high_irqload
*** 7.13 sched_cpu_high_irqload

Appears at: /proc/sys/kernel/sched_cpu_high_irqload

@@ -1163,7 +1153,7 @@ longer eligible for placement. This will affect the task placement logic
described above, causing the scheduler to try and steer tasks away from
the CPU.

*** 7.15 cpu.upmigrate_discourage
*** 7.14 cpu.upmigrate_discourage

Default value : 0

@@ -1179,7 +1169,7 @@ overcommitted scenario. See notes on sched_spill_nr_run and sched_spill_load for
how overcommitment threshold is defined and also notes on
'sched_upmigrate_min_nice' tunable.

*** 7.16 sched_static_cpu_pwr_cost
*** 7.15 sched_static_cpu_pwr_cost

Default value: 0

@@ -1194,7 +1184,7 @@ within a cluster and possibly have differing value between clusters as
needed.


*** 7.17 sched_static_cluster_pwr_cost
*** 7.16 sched_static_cluster_pwr_cost

Default value: 0

@@ -1205,7 +1195,7 @@ power mode. It ignores the actual D-state that a cluster may be in and assumes
the worst case power cost of the highest D-state. It is means of biasing task
placement away from idle clusters when necessary.

*** 7.18 sched_early_detection_duration
*** 7.17 sched_early_detection_duration

Default value: 9500000

@@ -1216,7 +1206,7 @@ tick for it to be eligible for the scheduler's early detection feature
under scheduler boost. For more information on the feature itself please
refer to section 5.2.1.

*** 7.19 sched_restrict_cluster_spill
*** 7.18 sched_restrict_cluster_spill

Default value: 0

@@ -1235,7 +1225,7 @@ CPU across all clusters. When this tunable is enabled, the RT tasks are
restricted to the lowest possible power cluster.


*** 7.20 sched_downmigrate
*** 7.19 sched_downmigrate

Appears at: /proc/sys/kernel/sched_downmigrate

@@ -1248,7 +1238,7 @@ its demand *in reference to the power-efficient cpu* drops less than 60%
(sched_downmigrate).


*** 7.21 sched_small_wakee_task_load
*** 7.20 sched_small_wakee_task_load

Appears at: /proc/sys/kernel/sched_small_wakee_task_load

@@ -1260,7 +1250,7 @@ categorized as small wakee tasks. Scheduler places small wakee tasks on the
waker's cluster.


*** 7.22 sched_big_waker_task_load
*** 7.21 sched_big_waker_task_load

Appears at: /proc/sys/kernel/sched_big_waker_task_load

@@ -1435,7 +1425,6 @@ cpus are being reset. Changes to below attributes result in such a reset:
* sched_ravg_window (See Sec 2)
* sched_window_stats_policy (See Sec 2.4)
* sched_ravg_hist_size (See Sec 7.11)
* sched_migration_fixup (See Sec 7.12)

<task>-0     [004] d.h4 12700.711489: sched_reset_all_windows_stats: time_taken 1123 window_start 0 window_size 0 reason POLICY_CHANGE old_val 0 new_val 1

+1 −1
Original line number Diff line number Diff line
@@ -44,7 +44,6 @@ extern unsigned int sysctl_sched_wakeup_load_threshold;
extern unsigned int sysctl_sched_window_stats_policy;
extern unsigned int sysctl_sched_ravg_hist_size;
extern unsigned int sysctl_sched_cpu_high_irqload;
extern unsigned int sysctl_sched_migration_fixup;
extern unsigned int sysctl_sched_heavy_task_pct;

#if defined(CONFIG_SCHED_FREQ_INPUT) || defined(CONFIG_SCHED_HMP)
@@ -75,6 +74,7 @@ extern unsigned int sysctl_sched_restrict_tasks_spread;
extern unsigned int sysctl_sched_account_wait_time;
extern unsigned int sysctl_sched_freq_account_wait_time;
extern unsigned int sysctl_sched_enable_power_aware;
extern unsigned int sysctl_sched_migration_fixup;
#else
extern unsigned int sysctl_sched_select_prev_cpu_us;
extern unsigned int sysctl_sched_enable_colocation;
+4 −16
Original line number Diff line number Diff line
@@ -1671,8 +1671,7 @@ struct cpu_cycle {
#if defined(CONFIG_SCHED_HMP)

/*
 * sched_window_stats_policy, sched_ravg_hist_size,
 * sched_migration_fixup have a 'sysctl' copy
 * sched_window_stats_policy and sched_ravg_hist_size have a 'sysctl' copy
 * associated with them. This is required for atomic update of those variables
 * when being modifed via sysctl interface.
 *
@@ -1710,9 +1709,6 @@ unsigned int __read_mostly sysctl_sched_enable_thread_grouping = 0;

__read_mostly unsigned int sysctl_sched_new_task_windows = 5;

static __read_mostly unsigned int sched_migration_fixup = 1;
__read_mostly unsigned int sysctl_sched_migration_fixup = 1;

#define SCHED_FREQ_ACCOUNT_WAIT_TIME 0

/*
@@ -3189,7 +3185,6 @@ enum reset_reason_code {
	WINDOW_CHANGE,
	POLICY_CHANGE,
	HIST_SIZE_CHANGE,
	MIGRATION_FIXUP_CHANGE,
	FREQ_AGGREGATE_CHANGE,
};

@@ -3197,7 +3192,6 @@ const char *sched_window_reset_reasons[] = {
	"WINDOW_CHANGE",
	"POLICY_CHANGE",
	"HIST_SIZE_CHANGE",
	"MIGRATION_FIXUP_CHANGE",
};

/* Called with IRQs enabled */
@@ -3267,12 +3261,7 @@ void reset_all_window_stats(u64 window_start, unsigned int window_size)
		sched_ravg_hist_size = sysctl_sched_ravg_hist_size;
	}
#ifdef CONFIG_SCHED_FREQ_INPUT
	else if (sched_migration_fixup != sysctl_sched_migration_fixup) {
		reason = MIGRATION_FIXUP_CHANGE;
		old = sched_migration_fixup;
		new = sysctl_sched_migration_fixup;
		sched_migration_fixup = sysctl_sched_migration_fixup;
	} else if (sched_freq_aggregate !=
	else if (sched_freq_aggregate !=
					sysctl_sched_freq_aggregate) {
		reason = FREQ_AGGREGATE_CHANGE;
		old = sched_freq_aggregate;
@@ -3514,8 +3503,7 @@ static void fixup_busy_time(struct task_struct *p, int new_cpu)
	bool new_task;
	struct related_thread_group *grp;

	if (!sched_enable_hmp || !sched_migration_fixup ||
		 (!p->on_rq && p->state != TASK_WAKING))
	if (!sched_enable_hmp || (!p->on_rq && p->state != TASK_WAKING))
		return;

	if (exiting_task(p)) {
+0 −3
Original line number Diff line number Diff line
@@ -3807,9 +3807,6 @@ DEFINE_MUTEX(policy_mutex);
#ifdef CONFIG_SCHED_FREQ_INPUT
static inline int invalid_value_freq_input(unsigned int *data)
{
	if (data == &sysctl_sched_migration_fixup)
		return !(*data == 0 || *data == 1);

	if (data == &sysctl_sched_freq_aggregate)
		return !(*data == 0 || *data == 1);

+7 −7
Original line number Diff line number Diff line
@@ -317,13 +317,6 @@ static struct ctl_table kern_table[] = {
		.proc_handler	= proc_dointvec_minmax,
		.extra1		= &zero,
	},
	{
		.procname       = "sched_migration_fixup",
		.data           = &sysctl_sched_migration_fixup,
		.maxlen         = sizeof(unsigned int),
		.mode           = 0644,
		.proc_handler   = sched_window_update_handler,
	},
	{
		.procname       = "sched_heavy_task",
		.data           = &sysctl_sched_heavy_task_pct,
@@ -402,6 +395,13 @@ static struct ctl_table kern_table[] = {
		.extra1		= &zero,
		.extra2		= &one,
	},
	{
		.procname       = "sched_migration_fixup",
		.data           = &sysctl_sched_migration_fixup,
		.maxlen         = sizeof(unsigned int),
		.mode           = 0644,
		.proc_handler   = sched_window_update_handler,
	},
#endif
#endif
	{