[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240812120819.1083687-1-zhengzucheng@huawei.com>
Date: Mon, 12 Aug 2024 12:08:19 +0000
From: Zheng Zucheng <zhengzucheng@...wei.com>
To: <mingo@...hat.com>, <peterz@...radead.org>, <juri.lelli@...hat.com>,
<vincent.guittot@...aro.org>, <dietmar.eggemann@....com>,
<rostedt@...dmis.org>, <bsegall@...gle.com>, <mgorman@...e.de>,
<vschneid@...hat.com>, <gregkh@...uxfoundation.org>
CC: <linux-kernel@...r.kernel.org>
Subject: [PATCH -next] sched: Remove the check on the return value of sched_update_scaling()
sched_update_scaling() always returns 0, so there's no need to check if
sched_update_scaling() was successful.
Fixes: 8a99b6833c88 ("sched: Move SCHED_DEBUG sysctl to debugfs")
Signed-off-by: Zheng Zucheng <zhengzucheng@...wei.com>
---
kernel/sched/debug.c | 3 +--
kernel/sched/fair.c | 4 +---
kernel/sched/sched.h | 2 +-
3 files changed, 3 insertions(+), 6 deletions(-)
diff --git a/kernel/sched/debug.c b/kernel/sched/debug.c
index 845b79238398..87c683c8635f 100644
--- a/kernel/sched/debug.c
+++ b/kernel/sched/debug.c
@@ -188,8 +188,7 @@ static ssize_t sched_scaling_write(struct file *filp, const char __user *ubuf,
return -EINVAL;
sysctl_sched_tunable_scaling = scaling;
- if (sched_update_scaling())
- return -EINVAL;
+ sched_update_scaling();
*ppos += cnt;
return cnt;
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index efb2b3062179..b3d79b693021 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -954,7 +954,7 @@ struct sched_entity *__pick_last_entity(struct cfs_rq *cfs_rq)
* Scheduling class statistics methods:
*/
#ifdef CONFIG_SMP
-int sched_update_scaling(void)
+void sched_update_scaling(void)
{
unsigned int factor = get_update_sysctl_factor();
@@ -962,8 +962,6 @@ int sched_update_scaling(void)
(normalized_sysctl_##name = sysctl_##name / (factor))
WRT_SYSCTL(sched_base_slice);
#undef WRT_SYSCTL
-
- return 0;
}
#endif
#endif
diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h
index 9373426d5aae..d8319e58a0c6 100644
--- a/kernel/sched/sched.h
+++ b/kernel/sched/sched.h
@@ -2054,7 +2054,7 @@ static inline void update_sched_domain_debugfs(void) { }
static inline void dirty_sched_domain_sysctl(int cpu) { }
#endif
-extern int sched_update_scaling(void);
+extern void sched_update_scaling(void);
static inline const struct cpumask *task_user_cpus(struct task_struct *p)
{
--
2.34.1
Powered by blists - more mailing lists