Skip to content

Commit

Permalink
sched: Remove struct sched_class::next field
Browse files Browse the repository at this point in the history
Now that the sched_class descriptors are defined in order via the linker
script vmlinux.lds.h, there's no reason to have a "next" pointer to the
previous priroity structure. The order of the sturctures can be aligned as
an array, and used to index and find the next sched_class descriptor.

Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lkml.kernel.org/r/20191219214558.845353593@goodmis.org
  • Loading branch information
Steven Rostedt (VMware) authored and Peter Zijlstra committed Jun 25, 2020
1 parent c3a340f commit a87e749
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 6 deletions.
1 change: 0 additions & 1 deletion kernel/sched/deadline.c
Original file line number Diff line number Diff line change
Expand Up @@ -2481,7 +2481,6 @@ static void prio_changed_dl(struct rq *rq, struct task_struct *p,

const struct sched_class dl_sched_class
__attribute__((section("__dl_sched_class"))) = {
.next = &rt_sched_class,
.enqueue_task = enqueue_task_dl,
.dequeue_task = dequeue_task_dl,
.yield_task = yield_task_dl,
Expand Down
1 change: 0 additions & 1 deletion kernel/sched/fair.c
Original file line number Diff line number Diff line change
Expand Up @@ -11124,7 +11124,6 @@ static unsigned int get_rr_interval_fair(struct rq *rq, struct task_struct *task
*/
const struct sched_class fair_sched_class
__attribute__((section("__fair_sched_class"))) = {
.next = &idle_sched_class,
.enqueue_task = enqueue_task_fair,
.dequeue_task = dequeue_task_fair,
.yield_task = yield_task_fair,
Expand Down
1 change: 0 additions & 1 deletion kernel/sched/idle.c
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,6 @@ static void update_curr_idle(struct rq *rq)
*/
const struct sched_class idle_sched_class
__attribute__((section("__idle_sched_class"))) = {
/* .next is NULL */
/* no enqueue/yield_task for idle tasks */

/* dequeue is not valid, we print a debug message there: */
Expand Down
1 change: 0 additions & 1 deletion kernel/sched/rt.c
Original file line number Diff line number Diff line change
Expand Up @@ -2431,7 +2431,6 @@ static unsigned int get_rr_interval_rt(struct rq *rq, struct task_struct *task)

const struct sched_class rt_sched_class
__attribute__((section("__rt_sched_class"))) = {
.next = &fair_sched_class,
.enqueue_task = enqueue_task_rt,
.dequeue_task = dequeue_task_rt,
.yield_task = yield_task_rt,
Expand Down
1 change: 0 additions & 1 deletion kernel/sched/sched.h
Original file line number Diff line number Diff line change
Expand Up @@ -1754,7 +1754,6 @@ extern const u32 sched_prio_to_wmult[40];
#define RETRY_TASK ((void *)-1UL)

struct sched_class {
const struct sched_class *next;

#ifdef CONFIG_UCLAMP_TASK
int uclamp_enabled;
Expand Down
1 change: 0 additions & 1 deletion kernel/sched/stop_task.c
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ static void update_curr_stop(struct rq *rq)
*/
const struct sched_class stop_sched_class
__attribute__((section("__stop_sched_class"))) = {
.next = &dl_sched_class,

.enqueue_task = enqueue_task_stop,
.dequeue_task = dequeue_task_stop,
Expand Down

0 comments on commit a87e749

Please sign in to comment.