Commit a7ebb58e authored by Hui Tang's avatar Hui Tang Committed by Yipeng Zou
Browse files

sched: Adjust few parameters range for smart grid

hulk inclusion
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I7EEF3


CVE: NA

-------------------------------

Adjust few parameters range for smart grid.

Fixes: 713cfd26 ("sched: Introduce smart grid scheduling strategy for cfs")
Signed-off-by: default avatarHui Tang <tanghui20@huawei.com>
Reviewed-by: default avatarZhang Qiao <zhangqiao22@huawei.com>
Signed-off-by: default avatarZhang Changzhong <zhangchangzhong@huawei.com>
Signed-off-by: default avatarYipeng Zou <zouyipeng@huawei.com>
parent 2f31dbde
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -9568,7 +9568,7 @@ int tg_set_affinity_period(struct task_group *tg, u64 period_ms)
	if (unlikely(!tg->auto_affinity))
		return -EPERM;

	if (period_ms > U64_MAX / NSEC_PER_MSEC)
	if (!period_ms || period_ms > U64_MAX / NSEC_PER_MSEC)
		return -EINVAL;

	raw_spin_lock_irq(&tg->auto_affinity->lock);
+4 −2
Original line number Diff line number Diff line
@@ -125,7 +125,7 @@ static int one_thousand = 1000;
#ifdef CONFIG_PRINTK
static int ten_thousand = 10000;
#endif
#ifdef CONFIG_QOS_SCHED
#if defined(CONFIG_QOS_SCHED) || defined(CONFIG_QOS_SCHED_SMART_GRID)
static int hundred_thousand = 100000;
#endif
#ifdef CONFIG_PERF_EVENTS
@@ -2809,7 +2809,9 @@ static struct ctl_table kern_table[] = {
		.data		= &sysctl_affinity_adjust_delay_ms,
		.maxlen		= sizeof(unsigned int),
		.mode		= 0644,
		.proc_handler	= proc_dointvec,
		.proc_handler   = proc_dointvec_minmax,
		.extra1         = SYSCTL_ZERO,
		.extra2		= &hundred_thousand,
	},
#endif
	{ }