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

Commit f777e92e authored by Amir Vajid's avatar Amir Vajid
Browse files

sched: walt: Improve the scheduler



This change is for general scheduler improvements.

Change-Id: I8e0a1d29ec170f6b628d63e685600da80c1aca8a
Signed-off-by: default avatarAmir Vajid <avajid@codeaurora.org>
parent 66b4463f
Loading
Loading
Loading
Loading
+5 −1
Original line number Original line Diff line number Diff line
@@ -48,8 +48,9 @@ extern unsigned int __weak sysctl_sched_task_unfilter_period;
extern unsigned int __weak sysctl_sched_busy_hyst_enable_cpus;
extern unsigned int __weak sysctl_sched_busy_hyst_enable_cpus;
extern unsigned int __weak sysctl_sched_busy_hyst;
extern unsigned int __weak sysctl_sched_busy_hyst;
extern unsigned int __weak sysctl_sched_coloc_busy_hyst_enable_cpus;
extern unsigned int __weak sysctl_sched_coloc_busy_hyst_enable_cpus;
extern unsigned int __weak sysctl_sched_coloc_busy_hyst;
extern unsigned int __weak sysctl_sched_coloc_busy_hyst_cpu[NR_CPUS];
extern unsigned int __weak sysctl_sched_coloc_busy_hyst_max_ms;
extern unsigned int __weak sysctl_sched_coloc_busy_hyst_max_ms;
extern unsigned int __weak sysctl_sched_coloc_busy_hyst_cpu_busy_pct[NR_CPUS];
extern unsigned int __weak sysctl_sched_window_stats_policy;
extern unsigned int __weak sysctl_sched_window_stats_policy;
extern unsigned int __weak sysctl_sched_ravg_window_nr_ticks;
extern unsigned int __weak sysctl_sched_ravg_window_nr_ticks;
extern unsigned int __weak sysctl_sched_many_wakeup_threshold;
extern unsigned int __weak sysctl_sched_many_wakeup_threshold;
@@ -77,6 +78,9 @@ sched_ravg_window_handler(struct ctl_table *table, int write,


extern int sched_boost_handler(struct ctl_table *table, int write,
extern int sched_boost_handler(struct ctl_table *table, int write,
			void __user *buffer, size_t *lenp, loff_t *ppos);
			void __user *buffer, size_t *lenp, loff_t *ppos);

extern int sched_busy_hyst_handler(struct ctl_table *table, int write,
			void __user *buffer, size_t *lenp, loff_t *ppos);
#endif
#endif


#if defined(CONFIG_PREEMPTIRQ_EVENTS) || defined(CONFIG_PREEMPT_TRACER)
#if defined(CONFIG_PREEMPTIRQ_EVENTS) || defined(CONFIG_PREEMPT_TRACER)
+6 −0
Original line number Original line Diff line number Diff line
@@ -123,6 +123,12 @@ int __weak sched_boost_handler(struct ctl_table *table, int write,
	return -ENOSYS;
	return -ENOSYS;
}
}


int __weak sched_busy_hyst_handler(struct ctl_table *table, int write,
			void __user *buffer, size_t *lenp, loff_t *ppos)
{
	return -ENOSYS;
}

u64 __weak sched_ktime_clock(void) { return 0; }
u64 __weak sched_ktime_clock(void) { return 0; }


unsigned long __weak
unsigned long __weak
+17 −26
Original line number Original line Diff line number Diff line
@@ -64,7 +64,6 @@
#include <linux/binfmts.h>
#include <linux/binfmts.h>
#include <linux/sched/sysctl.h>
#include <linux/sched/sysctl.h>
#include <linux/sched/coredump.h>
#include <linux/sched/coredump.h>
#include <linux/sched/stat.h>
#include <linux/kexec.h>
#include <linux/kexec.h>
#include <linux/bpf.h>
#include <linux/bpf.h>
#include <linux/mount.h>
#include <linux/mount.h>
@@ -242,10 +241,6 @@ static int proc_dostring_coredump(struct ctl_table *table, int write,
#endif
#endif
static int proc_dopipe_max_size(struct ctl_table *table, int write,
static int proc_dopipe_max_size(struct ctl_table *table, int write,
		void __user *buffer, size_t *lenp, loff_t *ppos);
		void __user *buffer, size_t *lenp, loff_t *ppos);
#ifdef CONFIG_SCHED_WALT
static int proc_douintvec_minmax_schedhyst(struct ctl_table *table, int write,
		void __user *buffer, size_t *lenp, loff_t *ppos);
#endif


#ifdef CONFIG_MAGIC_SYSRQ
#ifdef CONFIG_MAGIC_SYSRQ
/* Note: sysrq code uses its own private copy */
/* Note: sysrq code uses its own private copy */
@@ -513,7 +508,7 @@ static struct ctl_table kern_table[] = {
		.data		= &sysctl_sched_busy_hyst_enable_cpus,
		.data		= &sysctl_sched_busy_hyst_enable_cpus,
		.maxlen		= sizeof(unsigned int),
		.maxlen		= sizeof(unsigned int),
		.mode		= 0644,
		.mode		= 0644,
		.proc_handler	= proc_douintvec_minmax_schedhyst,
		.proc_handler	= sched_busy_hyst_handler,
		.extra1		= SYSCTL_ZERO,
		.extra1		= SYSCTL_ZERO,
		.extra2		= &two_hundred_fifty_five,
		.extra2		= &two_hundred_fifty_five,
	},
	},
@@ -522,7 +517,7 @@ static struct ctl_table kern_table[] = {
		.data		= &sysctl_sched_busy_hyst,
		.data		= &sysctl_sched_busy_hyst,
		.maxlen		= sizeof(unsigned int),
		.maxlen		= sizeof(unsigned int),
		.mode		= 0644,
		.mode		= 0644,
		.proc_handler	= proc_douintvec_minmax_schedhyst,
		.proc_handler	= sched_busy_hyst_handler,
		.extra1		= SYSCTL_ZERO,
		.extra1		= SYSCTL_ZERO,
		.extra2		= &ns_per_sec,
		.extra2		= &ns_per_sec,
	},
	},
@@ -531,16 +526,16 @@ static struct ctl_table kern_table[] = {
		.data		= &sysctl_sched_coloc_busy_hyst_enable_cpus,
		.data		= &sysctl_sched_coloc_busy_hyst_enable_cpus,
		.maxlen		= sizeof(unsigned int),
		.maxlen		= sizeof(unsigned int),
		.mode		= 0644,
		.mode		= 0644,
		.proc_handler	= proc_douintvec_minmax_schedhyst,
		.proc_handler	= sched_busy_hyst_handler,
		.extra1		= SYSCTL_ZERO,
		.extra1		= SYSCTL_ZERO,
		.extra2		= &two_hundred_fifty_five,
		.extra2		= &two_hundred_fifty_five,
	},
	},
	{
	{
		.procname	= "sched_coloc_busy_hyst_ns",
		.procname	= "sched_coloc_busy_hyst_cpu_ns",
		.data		= &sysctl_sched_coloc_busy_hyst,
		.data		= &sysctl_sched_coloc_busy_hyst_cpu,
		.maxlen		= sizeof(unsigned int),
		.maxlen		= sizeof(unsigned int) * NR_CPUS,
		.mode		= 0644,
		.mode		= 0644,
		.proc_handler	= proc_douintvec_minmax_schedhyst,
		.proc_handler	= sched_busy_hyst_handler,
		.extra1		= SYSCTL_ZERO,
		.extra1		= SYSCTL_ZERO,
		.extra2		= &ns_per_sec,
		.extra2		= &ns_per_sec,
	},
	},
@@ -549,10 +544,19 @@ static struct ctl_table kern_table[] = {
		.data		= &sysctl_sched_coloc_busy_hyst_max_ms,
		.data		= &sysctl_sched_coloc_busy_hyst_max_ms,
		.maxlen		= sizeof(unsigned int),
		.maxlen		= sizeof(unsigned int),
		.mode		= 0644,
		.mode		= 0644,
		.proc_handler	= proc_douintvec_minmax_schedhyst,
		.proc_handler	= sched_busy_hyst_handler,
		.extra1		= SYSCTL_ZERO,
		.extra1		= SYSCTL_ZERO,
		.extra2		= &one_hundred_thousand,
		.extra2		= &one_hundred_thousand,
	},
	},
	{
		.procname	= "sched_coloc_busy_hyst_cpu_busy_pct",
		.data		= &sysctl_sched_coloc_busy_hyst_cpu_busy_pct,
		.maxlen		= sizeof(unsigned int) * NR_CPUS,
		.mode		= 0644,
		.proc_handler	= sched_busy_hyst_handler,
		.extra1		= SYSCTL_ZERO,
		.extra2		= &one_hundred,
	},
	{
	{
		.procname	= "sched_ravg_window_nr_ticks",
		.procname	= "sched_ravg_window_nr_ticks",
		.data		= &sysctl_sched_ravg_window_nr_ticks,
		.data		= &sysctl_sched_ravg_window_nr_ticks,
@@ -3165,19 +3169,6 @@ static int proc_dostring_coredump(struct ctl_table *table, int write,
}
}
#endif
#endif


#ifdef CONFIG_SCHED_WALT
static int proc_douintvec_minmax_schedhyst(struct ctl_table *table, int write,
				void __user *buffer, size_t *lenp, loff_t *ppos)
{
	int ret = proc_douintvec_minmax(table, write, buffer, lenp, ppos);

	if (!ret && write)
		sched_update_hyst_times();

	return ret;
}
#endif

static int __do_proc_doulongvec_minmax(void *data, struct ctl_table *table, int write,
static int __do_proc_doulongvec_minmax(void *data, struct ctl_table *table, int write,
				     void __user *buffer,
				     void __user *buffer,
				     size_t *lenp, loff_t *ppos,
				     size_t *lenp, loff_t *ppos,