sched: Add snapshot of sched_{up,down}migrate knobs

This snapshot is taken from msm-4.19 as of commit 89986132507b822
("sched: fair: Improve the scheduler").

Change-Id: I9a52e67862ee5086880884128102aa4f8efb04ce
Signed-off-by: Satya Durga Srinivasu Prabhala <satyap@codeaurora.org>
This commit is contained in:
Satya Durga Srinivasu Prabhala 2018-11-14 17:01:12 -08:00 • committed by Gerrit - the friendly Code Review server
commit d7a8a6765e
5 changed files with 92 additions and 4 deletions

View file

@ -504,6 +504,20 @@ static struct ctl_table kern_table[] = {
.mode = 0644,
.proc_handler = sched_ravg_window_handler,
},
{
.procname = "sched_upmigrate",
.data = &sysctl_sched_capacity_margin_up,
.maxlen = sizeof(unsigned int) * MAX_MARGIN_LEVELS,
.mode = 0644,
.proc_handler = sched_updown_migrate_handler,
},
{
.procname = "sched_downmigrate",
.data = &sysctl_sched_capacity_margin_down,
.maxlen = sizeof(unsigned int) * MAX_MARGIN_LEVELS,
.mode = 0644,
.proc_handler = sched_updown_migrate_handler,
},
#endif
#ifdef CONFIG_SCHED_DEBUG
{
@ -3531,6 +3545,43 @@ int proc_do_large_bitmap(struct ctl_table *table, int write,
return err;
}
static int do_proc_douintvec_capacity_conv(bool *negp, unsigned long *lvalp,
int *valp, int write, void *data)
{
if (write) {
/*
* The sched_upmigrate/sched_downmigrate tunables are
* accepted in percentage. Limit them to 100.
*/
if (*negp || *lvalp == 0 || *lvalp > 100)
return -EINVAL;
*valp = SCHED_FIXEDPOINT_SCALE * 100 / *lvalp;
} else {
*negp = false;
*lvalp = SCHED_FIXEDPOINT_SCALE * 100 / *valp;
}
return 0;
}
/**
* proc_douintvec_capacity - read a vector of integers in percentage and convert
* into sched capacity
* @table: the sysctl table
* @write: %TRUE if this is a write to the sysctl file
* @buffer: the user buffer
* @lenp: the size of the user buffer
* @ppos: file position
*
* Returns 0 on success.
*/
int proc_douintvec_capacity(struct ctl_table *table, int write,
void __user *buffer, size_t *lenp, loff_t *ppos)
{
return do_proc_dointvec(table, write, buffer, lenp, ppos,
do_proc_douintvec_capacity_conv, NULL);
}
static int do_proc_douintvec_rwin(bool *negp, unsigned long *lvalp,
int *valp, int write, void *data)
{
@ -3629,6 +3680,12 @@ int proc_douintvec_ravg_window(struct ctl_table *table, int write,
return -ENOSYS;
}
int proc_douintvec_capacity(struct ctl_table *table, int write,
void __user *buffer, size_t *lenp, loff_t *ppos)
{
return -ENOSYS;
}
#endif /* CONFIG_PROC_SYSCTL */
#if defined(CONFIG_SYSCTL)