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

Commit f8edf202 authored by Satya Durga Srinivasu Prabhala's avatar Satya Durga Srinivasu Prabhala
Browse files

Revert "sched/sysctl: check for min/max values for sched_{up,down}_migrate knobs"



An issue is introduced by 'commit a8ce96ad ("sched/sysctl: check
for min/max values for sched_{up,down}_migrate knobs")' where code ends up
checking always first value of the sched_{up,down}_migrate knobs instead
of checking each value separately in case of multi cluster systems with
more than 2 clusters. This leads to an unexpected behavior as user would
see old values instead of new values like below.

	# cat /proc/sys/kernel/sched_upmigrate
	60 60
	# cat /proc/sys/kernel/sched_downmigrate
	40 40
	# echo "60 95" > /proc/sys/kernel/sched_upmigrate
	# cat /proc/sys/kernel/sched_upmigrate
	60 95
	# echo "40 85" > /proc/sys/kernel/sched_downmigrate
	# cat /proc/sys/kernel/sched_downmigrate
	40 40

The issue that 'commit a8ce96ad ("sched/sysctl: check
for min/max values for sched_{up,down}_migrate knobs")' tried to
resolve is also fixed by 'commit 957cc168 ("sched: restore
all values for sched_{up,down}_migrate knobs in error case")'.
Hence, revert 'commit a8ce96ad ("sched/sysctl: check
for min/max values for sched_{up,down}_migrate knobs")' which
isn't even needed now.

Change-Id: Iec0d569c5c1ee95a04bf77726c1c459b92abd9af
Signed-off-by: default avatarSatya Durga Srinivasu Prabhala <satyap@codeaurora.org>
parent cecc0b27
Loading
Loading
Loading
Loading
+2 −20
Original line number Diff line number Diff line
@@ -389,8 +389,6 @@ static struct ctl_table kern_table[] = {
		.maxlen		= sizeof(unsigned int) * MAX_MARGIN_LEVELS,
		.mode		= 0644,
		.proc_handler	= sched_updown_migrate_handler,
		.extra1		= &one,
		.extra2		= &sysctl_sched_capacity_margin_down,
	},
	{
		.procname	= "sched_downmigrate",
@@ -398,7 +396,6 @@ static struct ctl_table kern_table[] = {
		.maxlen		= sizeof(unsigned int) * MAX_MARGIN_LEVELS,
		.mode		= 0644,
		.proc_handler	= sched_updown_migrate_handler,
		.extra1		= &sysctl_sched_capacity_margin_up,
	},
#ifdef CONFIG_SCHED_DEBUG
	{
@@ -3270,20 +3267,10 @@ int proc_do_large_bitmap(struct ctl_table *table, int write,
static int do_proc_douintvec_capacity_conv(bool *negp, unsigned long *lvalp,
					   int *valp, int write, void *data)
{
	struct do_proc_douintvec_minmax_conv_param *param = data;

	if (write) {
		int val;

		if (*negp)
			return -EINVAL;

		val = SCHED_FIXEDPOINT_SCALE * 100 / *lvalp;
		if ((param->min && *param->min > val) ||
		    (param->max && *param->max < val))
			return -ERANGE;

		*valp = val;
		*valp = SCHED_FIXEDPOINT_SCALE * 100 / *lvalp;
	} else {
		*negp = false;
		*lvalp = SCHED_FIXEDPOINT_SCALE * 100 / *valp;
@@ -3306,13 +3293,8 @@ static int do_proc_douintvec_capacity_conv(bool *negp, unsigned long *lvalp,
int proc_douintvec_capacity(struct ctl_table *table, int write,
			    void __user *buffer, size_t *lenp, loff_t *ppos)
{
	struct do_proc_douintvec_minmax_conv_param param = {
		.min = (unsigned int *) table->extra1,
		.max = (unsigned int *) table->extra2,
	};

	return do_proc_dointvec(table, write, buffer, lenp, ppos,
				do_proc_douintvec_capacity_conv, &param);
				do_proc_douintvec_capacity_conv, NULL);
}

#else /* CONFIG_PROC_SYSCTL */