Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

sched_ext: Remove switch_class_scx()

Now that put_prev_task_scx() is called with @next on task switches, there's
no reason to use sched_class.switch_class(). Rename switch_class_scx() to
switch_class() and call it from put_prev_task_scx().

Signed-off-by: Tejun Heo <tj@kernel.org>

+4 -5
+4 -5
kernel/sched/ext.c
··· 2723 2723 return SCX_CPU_PREEMPT_UNKNOWN; 2724 2724 } 2725 2725 2726 - static void switch_class_scx(struct rq *rq, struct task_struct *next) 2726 + static void switch_class(struct rq *rq, struct task_struct *next) 2727 2727 { 2728 2728 const struct sched_class *next_class = next->sched_class; 2729 2729 2730 - if (!scx_enabled()) 2731 - return; 2732 2730 #ifdef CONFIG_SMP 2733 2731 /* 2734 2732 * Pairs with the smp_load_acquire() issued by a CPU in ··· 2806 2808 do_enqueue_task(rq, p, 0, -1); 2807 2809 } 2808 2810 } 2811 + 2812 + if (next && next->sched_class != &ext_sched_class) 2813 + switch_class(rq, next); 2809 2814 } 2810 2815 2811 2816 static struct task_struct *first_local_task(struct rq *rq) ··· 3591 3590 3592 3591 .put_prev_task = put_prev_task_scx, 3593 3592 .set_next_task = set_next_task_scx, 3594 - 3595 - .switch_class = switch_class_scx, 3596 3593 3597 3594 #ifdef CONFIG_SMP 3598 3595 .select_task_rq = select_task_rq_scx,