summaryrefslogtreecommitdiff
path: root/kernel/sched/ext.h
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2024-06-20 12:15:02 -1000
committerTejun Heo <tj@kernel.org>2024-06-21 09:49:28 -1000
commitb999e365c2982dbd50f01fec520215d3c61ea2aa (patch)
tree7f7001db61c757b0c8e4613e82af80ac7d0aa2ed /kernel/sched/ext.h
parenta5db7817af780db6a7f290c79677eff4fd13c5fa (diff)
sched, sched_ext: Replace scx_next_task_picked() with sched_class->switch_class()
scx_next_task_picked() is used by sched_ext to notify the BPF scheduler when a CPU is taken away by a task dispatched from a higher priority sched_class so that the BPF scheduler can, e.g., punt the task[s] which was running or were waiting for the CPU to other CPUs. Replace the sched_ext specific hook scx_next_task_picked() with a new sched_class operation switch_class(). The changes are straightforward and the code looks better afterwards. However, when !CONFIG_SCHED_CLASS_EXT, this ends up adding an unused hook which is unlikely to be useful to other sched_classes. For further discussion on this subject, please refer to the following: http://lkml.kernel.org/r/CAHk-=wjFPLqo7AXu8maAGEGnOy6reUg-F4zzFhVB0Kyu22h7pw@mail.gmail.com Signed-off-by: Tejun Heo <tj@kernel.org> Suggested-by: Linus Torvalds <torvalds@linux-foundation.org> Cc: Ingo Molnar <mingo@redhat.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'kernel/sched/ext.h')
-rw-r--r--kernel/sched/ext.h4
1 files changed, 0 insertions, 4 deletions
diff --git a/kernel/sched/ext.h b/kernel/sched/ext.h
index c41d742b5d62..bf6f2cfa49d5 100644
--- a/kernel/sched/ext.h
+++ b/kernel/sched/ext.h
@@ -33,8 +33,6 @@ static inline bool task_on_scx(const struct task_struct *p)
return scx_enabled() && p->sched_class == &ext_sched_class;
}
-void scx_next_task_picked(struct rq *rq, struct task_struct *p,
- const struct sched_class *active);
void scx_tick(struct rq *rq);
void init_scx_entity(struct sched_ext_entity *scx);
void scx_pre_fork(struct task_struct *p);
@@ -82,8 +80,6 @@ bool scx_prio_less(const struct task_struct *a, const struct task_struct *b,
#define scx_enabled() false
#define scx_switched_all() false
-static inline void scx_next_task_picked(struct rq *rq, struct task_struct *p,
- const struct sched_class *active) {}
static inline void scx_tick(struct rq *rq) {}
static inline void scx_pre_fork(struct task_struct *p) {}
static inline int scx_fork(struct task_struct *p) { return 0; }