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

Commit 483fa0ad authored by Steve Muckle's avatar Steve Muckle
Browse files

sched: enable hmp, power aware scheduling for targets with > 4 CPUs



Enabling and disabling hmp/power-aware scheduling is meant to be done
via kernel command line options. Until that is fully supported however,
take advantage of the fact that current targets with more than 4 CPUs
will need these features.

Change-Id: I4916805881d58eeb54747e4b972816ffc96caae7
Signed-off-by: default avatarSteve Muckle <smuckle@codeaurora.org>
parent 0f7535de
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -8094,6 +8094,12 @@ void __init sched_init(void)
	int i, j;
	unsigned long alloc_size = 0, ptr;

	if (num_possible_cpus() > 4)
		sched_enable_hmp = sched_enable_power_aware = 1;

	if (sched_enable_hmp)
		pr_info("HMP scheduling enabled.\n");

	BUG_ON(num_possible_cpus() > BITS_PER_LONG);

#ifdef CONFIG_FAIR_GROUP_SCHED
+2 −2
Original line number Diff line number Diff line
@@ -1250,7 +1250,7 @@ unsigned int max_task_load(void)
#ifdef CONFIG_SCHED_HMP

/* Use this knob to turn on or off HMP-aware task placement logic */
unsigned int __read_mostly sched_enable_hmp = 1;
unsigned int __read_mostly sched_enable_hmp = 0;

/* A cpu can no longer accomodate more tasks if:
 *
@@ -1271,7 +1271,7 @@ unsigned int __read_mostly sysctl_sched_mostly_idle_nr_run = 3;
 * Control whether or not individual CPU power consumption is used to
 * guide task placement.
 */
unsigned int __read_mostly sched_enable_power_aware = 1;
unsigned int __read_mostly sched_enable_power_aware = 0;

/*
 * This specifies the maximum percent power difference between 2