[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240802111018.GI39708@noisy.programming.kicks-ass.net>
Date: Fri, 2 Aug 2024 13:10:18 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Tejun Heo <tj@...nel.org>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>,
linux-kernel@...r.kernel.org, David Vernet <void@...ifault.com>,
Ingo Molnar <mingo@...hat.com>, Alexei Starovoitov <ast@...nel.org>,
Thomas Gleixner <tglx@...utronix.de>
Subject: Re: [GIT PULL] sched_ext: Initial pull request for v6.11
On Tue, Jul 30, 2024 at 03:36:27PM -1000, Tejun Heo wrote:
> > Or make scx hard depend on SMP? Are there really still people using !SMP
> > -- and I suppose more importantly, do we care?
> >
> > I mean, they could always run an SMP kernel on their UP potato if they
> > *really* feel they need this.
>
> Maybe, but at the same time, it's also just some isolated cruft that enables
> UP support, so both sides of the scale seem similarly light-weight? I lean
> towards "why not support it?" but don't feel particularly strongly about it.
So you're basically looking for something like this?
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index a9f655025607..69ec02a28117 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -5772,7 +5772,6 @@ static inline void schedule_debug(struct task_struct *prev, bool preempt)
static void put_prev_task_balance(struct rq *rq, struct task_struct *prev,
struct rq_flags *rf)
{
-#ifdef CONFIG_SMP
const struct sched_class *class;
/*
* We must do the balancing pass before put_prev_task(), such
@@ -5783,10 +5782,9 @@ static void put_prev_task_balance(struct rq *rq, struct task_struct *prev,
* a runnable task of @class priority or higher.
*/
for_class_range(class, prev->sched_class, &idle_sched_class) {
- if (class->balance(rq, prev, rf))
+ if (class->balance && class->balance(rq, prev, rf))
break;
}
-#endif
put_prev_task(rq, prev);
}
diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h
index 4c36cc680361..40f3dc436f4f 100644
--- a/kernel/sched/sched.h
+++ b/kernel/sched/sched.h
@@ -2296,8 +2296,8 @@ struct sched_class {
void (*put_prev_task)(struct rq *rq, struct task_struct *p);
void (*set_next_task)(struct rq *rq, struct task_struct *p, bool first);
-#ifdef CONFIG_SMP
int (*balance)(struct rq *rq, struct task_struct *prev, struct rq_flags *rf);
+#ifdef CONFIG_SMP
int (*select_task_rq)(struct task_struct *p, int task_cpu, int flags);
struct task_struct * (*pick_task)(struct rq *rq);
Powered by blists - more mailing lists