mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: void@manifault.com
Cc: kernel-team@meta.com, linux-kernel@vger.kernel.org,
	peterz@infradead.org, Tejun Heo <tj@kernel.org>
Subject: [PATCH 6/6] sched_ext: Remove sched_class->switch_class()
Date: Tue,  3 Sep 2024 22:03:08 -1000	[thread overview]
Message-ID: <20240904080326.1132275-7-tj@kernel.org> (raw)
In-Reply-To: <20240904080326.1132275-1-tj@kernel.org>

With sched_ext converted to use put_prev_task() for class switch detection,
there's no user of switch_class() left. Drop it.

Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
---
 kernel/sched/core.c  | 12 +-----------
 kernel/sched/sched.h |  2 --
 2 files changed, 1 insertion(+), 13 deletions(-)

diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 91bedf5d9f89..df56301bfa97 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -5965,22 +5965,12 @@ __pick_next_task(struct rq *rq, struct task_struct *prev, struct rq_flags *rf)
 	for_each_active_class(class) {
 		if (class->pick_next_task) {
 			p = class->pick_next_task(rq, prev);
-			if (p) {
-				const struct sched_class *prev_class = prev->sched_class;
-
-				if (class != prev_class && prev_class->switch_class)
-					prev_class->switch_class(rq, p);
+			if (p)
 				return p;
-			}
 		} else {
 			p = class->pick_task(rq);
 			if (p) {
-				const struct sched_class *prev_class = prev->sched_class;
-
 				put_prev_set_next_task(rq, prev, p);
-
-				if (class != prev_class && prev_class->switch_class)
-					prev_class->switch_class(rq, p);
 				return p;
 			}
 		}
diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h
index 477e7a861d10..73ba0cfe4226 100644
--- a/kernel/sched/sched.h
+++ b/kernel/sched/sched.h
@@ -2385,8 +2385,6 @@ struct sched_class {
 	void (*put_prev_task)(struct rq *rq, struct task_struct *p, struct task_struct *next);
 	void (*set_next_task)(struct rq *rq, struct task_struct *p, bool first);
 
-	void (*switch_class)(struct rq *rq, struct task_struct *next);
-
 #ifdef CONFIG_SMP
 	int  (*select_task_rq)(struct task_struct *p, int task_cpu, int flags);
 
-- 
2.46.0


  parent reply	other threads:[~2024-09-04  8:03 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-04  8:03 [PATCHSET sched_ext/for-6.12] sched_ext: Apply pick_next_task() updates and remove switch_class() Tejun Heo
2024-09-04  8:03 ` [PATCH 1/6] sched_ext: Don't call put_prev_task_scx() before picking the next task Tejun Heo
2024-09-04  8:03 ` [PATCH 2/6] sched_ext: Replace SCX_TASK_BAL_KEEP with SCX_RQ_BAL_KEEP Tejun Heo
2024-09-04  8:03 ` [PATCH 3/6] sched_ext: Unify regular and core-sched pick task paths Tejun Heo
2024-09-04  8:03 ` [PATCH 4/6] sched_ext: Relocate functions in kernel/sched/ext.c Tejun Heo
2024-09-04  8:03 ` [PATCH 5/6] sched_ext: Remove switch_class_scx() Tejun Heo
2024-09-04  8:03 ` Tejun Heo [this message]
2024-09-04 20:19 ` [PATCHSET sched_ext/for-6.12] sched_ext: Apply pick_next_task() updates and remove switch_class() Tejun Heo

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=20240904080326.1132275-7-tj@kernel.org \
    --to=tj@kernel.org \
    --cc=kernel-team@meta.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peterz@infradead.org \
    --cc=void@manifault.com \
    /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®