Skip to content

Commit 37cb049

Browse files
committed
sched_ext: Remove sched_class->switch_class()
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 <[email protected]> Cc: Peter Zijlstra <[email protected]>
1 parent f422316 commit 37cb049

File tree

2 files changed

+1
-13
lines changed

2 files changed

+1
-13
lines changed

kernel/sched/core.c

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5965,22 +5965,12 @@ __pick_next_task(struct rq *rq, struct task_struct *prev, struct rq_flags *rf)
59655965
for_each_active_class(class) {
59665966
if (class->pick_next_task) {
59675967
p = class->pick_next_task(rq, prev);
5968-
if (p) {
5969-
const struct sched_class *prev_class = prev->sched_class;
5970-
5971-
if (class != prev_class && prev_class->switch_class)
5972-
prev_class->switch_class(rq, p);
5968+
if (p)
59735969
return p;
5974-
}
59755970
} else {
59765971
p = class->pick_task(rq);
59775972
if (p) {
5978-
const struct sched_class *prev_class = prev->sched_class;
5979-
59805973
put_prev_set_next_task(rq, prev, p);
5981-
5982-
if (class != prev_class && prev_class->switch_class)
5983-
prev_class->switch_class(rq, p);
59845974
return p;
59855975
}
59865976
}

kernel/sched/sched.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2385,8 +2385,6 @@ struct sched_class {
23852385
void (*put_prev_task)(struct rq *rq, struct task_struct *p, struct task_struct *next);
23862386
void (*set_next_task)(struct rq *rq, struct task_struct *p, bool first);
23872387

2388-
void (*switch_class)(struct rq *rq, struct task_struct *next);
2389-
23902388
#ifdef CONFIG_SMP
23912389
int (*select_task_rq)(struct task_struct *p, int task_cpu, int flags);
23922390

0 commit comments

Comments
 (0)