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

Commit d0100731 authored by Pavankumar Kondeti's avatar Pavankumar Kondeti Committed by Satya Durga Srinivasu Prabhala
Browse files

sched: Introduce sched_busy_hysteresis_enable_cpus tunable



Currently sched busy hysteresis feature is applied only for
CPUs other than the min capacity CPUs. This policy restricts
the flexibility on a system with more than 2 clusters. Add a
tunable to specify which CPUs needs this feature. By default,
the feature is turned off for all the CPUs.

The usage of this tunable:

echo 4-7 > /proc/sys/kernel/sched_busy_hysteresis_enable_cpus

Change-Id: I636575af2c42e2774007582f3d589495c6a3a9f1
Signed-off-by: default avatarPavankumar Kondeti <pkondeti@codeaurora.org>
Signed-off-by: default avatarSatya Durga Srinivasu Prabhala <satyap@codeaurora.org>
parent 517c8681
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -140,5 +140,6 @@ extern int sched_energy_aware_handler(struct ctl_table *table, int write,
extern char sched_lib_name[LIB_PATH_LENGTH];
extern unsigned int sched_lib_mask_check;
extern unsigned int sched_lib_mask_force;
extern unsigned long *sched_busy_hysteresis_cpubits;

#endif /* _LINUX_SCHED_SYSCTL_H */
+4 −1
Original line number Diff line number Diff line
@@ -26,6 +26,9 @@ static DEFINE_PER_CPU(unsigned long, iowait_prod_sum);
static DEFINE_PER_CPU(spinlock_t, nr_lock) = __SPIN_LOCK_UNLOCKED(nr_lock);
static s64 last_get_time;

static struct cpumask sched_busy_hysteresis_cpumask;
unsigned long *sched_busy_hysteresis_cpubits =
				cpumask_bits(&sched_busy_hysteresis_cpumask);
static DEFINE_PER_CPU(atomic64_t, last_busy_time) = ATOMIC64_INIT(0);

#define NR_THRESHOLD_PCT		15
@@ -102,7 +105,7 @@ static inline void update_last_busy_time(int cpu, bool dequeue,
{
	bool nr_run_trigger = false, load_trigger = false;

	if (!hmp_capable() || is_min_capacity_cpu(cpu))
	if (!cpumask_test_cpu(cpu, &sched_busy_hysteresis_cpumask))
		return;

	if (prev_nr_run >= BUSY_NR_RUN && per_cpu(nr, cpu) < BUSY_NR_RUN)
+9 −0
Original line number Diff line number Diff line
@@ -415,6 +415,7 @@ static struct ctl_table kern_table[] = {
		.extra2		= &two_million,
	},
#endif
#ifdef CONFIG_SMP
	{
		.procname	= "sched_upmigrate",
		.data		= &sysctl_sched_capacity_margin_up,
@@ -429,6 +430,14 @@ static struct ctl_table kern_table[] = {
		.mode		= 0644,
		.proc_handler	= sched_updown_migrate_handler,
	},
	{
		.procname	= "sched_busy_hysteresis_enable_cpus",
		.data		= &sched_busy_hysteresis_cpubits,
		.maxlen		= NR_CPUS,
		.mode		= 0644,
		.proc_handler	= proc_do_large_bitmap,
	},
#endif
#ifdef CONFIG_SCHED_DEBUG
	{
		.procname       = "sched_cstate_aware",