From: Tor Vic <torvic9@mailbox.org>
To: peterz@infradead.org, mingo@redhat.com, juri.lelli@redhat.com,
vincent.guittot@linaro.org, dietmar.eggemann@arm.com,
kprateek.nayak@amd.com
Cc: linux-kernel@vger.kernel.org, Tor Vic <torvic9@mailbox.org>
Subject: [RFC PATCH 2/2] sched/fair: Remove sched_base_slice scaling altogether
Date: Fri, 2 Oct 2026 14:45:38 +0200 [thread overview]
Message-ID: <20261002124538.79658-3-torvic9@mailbox.org> (raw)
In-Reply-To: <20261002124538.79658-1-torvic9@mailbox.org>
After having removed the 'none' and 'linear' scalings, remove the
entire tunable scaling mechanism altogether, and just set a fixed
default sched_base_slice of 2 msec.
This can still be changed through debugfs.
Signed-off-by: Tor Vic <torvic9@mailbox.org>
---
kernel/sched/core.c | 1 -
kernel/sched/fair.c | 53 +++-----------------------------------------
kernel/sched/sched.h | 3 ---
3 files changed, 3 insertions(+), 54 deletions(-)
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 1fe40de6ebe3..2a8a242e20e5 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -8942,7 +8942,6 @@ void __init sched_init_smp(void)
if (set_cpus_allowed_ptr(current, housekeeping_cpumask(HK_TYPE_DOMAIN)) < 0)
BUG();
current->flags &= ~PF_NO_SETAFFINITY;
- sched_init_granularity();
init_sched_rt_class();
init_sched_dl_class();
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 2f9b7d2fe813..3d59af44abdf 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -67,10 +67,10 @@
* Under EEVDF this is the request size used to compute the virtual
* deadline; see update_deadline().
*
- * (default: 0.70 msec * (1 + ilog(ncpus)), units: nanoseconds)
+ * (default: 2 msec)
*/
-unsigned int sysctl_sched_base_slice = 700000ULL;
-static unsigned int normalized_sysctl_sched_base_slice = 700000ULL;
+unsigned int sysctl_sched_base_slice = 2000000ULL;
+static unsigned int normalized_sysctl_sched_base_slice = 2000000ULL;
__read_mostly unsigned int sysctl_sched_migration_cost = 500000UL;
@@ -173,38 +173,6 @@ static inline void update_load_set(struct load_weight *lw, unsigned long w)
lw->inv_weight = 0;
}
-/*
- * Increase the granularity value when there are more CPUs,
- * because with more CPUs the 'effective latency' as visible
- * to users decreases. But the relationship is not linear,
- * so pick a second-best guess by going with the log2 of the
- * number of CPUs.
- *
- * This idea comes from the SD scheduler of Con Kolivas:
- */
-static unsigned int get_update_sysctl_factor(void)
-{
- unsigned int cpus = min_t(unsigned int, num_online_cpus(), 8);
- unsigned int factor = 1 + ilog2(cpus);
-
- return factor;
-}
-
-static void update_sysctl(void)
-{
- unsigned int factor = get_update_sysctl_factor();
-
-#define SET_SYSCTL(name) \
- (sysctl_##name = (factor) * normalized_sysctl_##name)
- SET_SYSCTL(sched_base_slice);
-#undef SET_SYSCTL
-}
-
-void __init sched_init_granularity(void)
-{
- update_sysctl();
-}
-
#ifndef CONFIG_64BIT
#define WMULT_CONST (~0U)
#define WMULT_SHIFT 32
@@ -1242,17 +1210,6 @@ struct sched_entity *__pick_last_entity(struct cfs_rq *cfs_rq)
/**************************************************************
* Scheduling class statistics methods:
*/
-int sched_update_scaling(void)
-{
- unsigned int factor = get_update_sysctl_factor();
-
-#define WRT_SYSCTL(name) \
- (normalized_sysctl_##name = sysctl_##name / (factor))
- WRT_SYSCTL(sched_base_slice);
-#undef WRT_SYSCTL
-
- return 0;
-}
static void clear_buddies(struct cfs_rq *cfs_rq, struct sched_entity *se);
@@ -15011,15 +14968,11 @@ void sched_balance_trigger(struct rq *rq)
static void rq_online_fair(struct rq *rq)
{
- update_sysctl();
-
update_runtime_enabled(rq);
}
static void rq_offline_fair(struct rq *rq)
{
- update_sysctl();
-
/* Ensure any throttled groups are reachable by pick_next_task */
unthrottle_offline_cfs_rqs(rq);
diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h
index 7a36b3210757..a323fdeb7125 100644
--- a/kernel/sched/sched.h
+++ b/kernel/sched/sched.h
@@ -2302,8 +2302,6 @@ extern int group_balance_cpu(struct sched_group *sg);
extern void update_sched_domain_debugfs(void);
extern void dirty_sched_domain_sysctl(int cpu);
-extern int sched_update_scaling(void);
-
static inline const struct cpumask *task_user_cpus(struct task_struct *p)
{
if (!p->user_cpus_ptr)
@@ -2987,7 +2985,6 @@ extern void schedule_idle(void);
asmlinkage void schedule_user(void);
extern void sysrq_sched_debug_show(void);
-extern void sched_init_granularity(void);
extern void update_max_interval(void);
extern void init_sched_dl_class(void);
--
2.55.0
prev parent reply other threads:[~2026-10-02 12:45 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-02 12:45 [RFC PATCH 0/2] sched/fair: Remove tunable scaling Tor Vic
2026-10-02 12:45 ` [RFC PATCH 1/2] sched/fair: Remove the 'none' and 'linear' scaling of tunables Tor Vic
2026-10-02 12:45 ` Tor Vic [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261002124538.79658-3-torvic9@mailbox.org \
--to=torvic9@mailbox.org \
--cc=dietmar.eggemann@arm.com \
--cc=juri.lelli@redhat.com \
--cc=kprateek.nayak@amd.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=vincent.guittot@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®