Skip to content

Commit a87e749

Browse files
rostedtPeter Zijlstra
authored andcommitted
sched: Remove struct sched_class::next field
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) <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Link: https://lkml.kernel.org/r/[email protected]
1 parent c3a340f commit a87e749

File tree

6 files changed

+0
-6
lines changed

6 files changed

+0
-6
lines changed

kernel/sched/deadline.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2481,7 +2481,6 @@ static void prio_changed_dl(struct rq *rq, struct task_struct *p,
24812481

24822482
const struct sched_class dl_sched_class
24832483
__attribute__((section("__dl_sched_class"))) = {
2484-
.next = &rt_sched_class,
24852484
.enqueue_task = enqueue_task_dl,
24862485
.dequeue_task = dequeue_task_dl,
24872486
.yield_task = yield_task_dl,

kernel/sched/fair.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11124,7 +11124,6 @@ static unsigned int get_rr_interval_fair(struct rq *rq, struct task_struct *task
1112411124
*/
1112511125
const struct sched_class fair_sched_class
1112611126
__attribute__((section("__fair_sched_class"))) = {
11127-
.next = &idle_sched_class,
1112811127
.enqueue_task = enqueue_task_fair,
1112911128
.dequeue_task = dequeue_task_fair,
1113011129
.yield_task = yield_task_fair,

kernel/sched/idle.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,6 @@ static void update_curr_idle(struct rq *rq)
455455
*/
456456
const struct sched_class idle_sched_class
457457
__attribute__((section("__idle_sched_class"))) = {
458-
/* .next is NULL */
459458
/* no enqueue/yield_task for idle tasks */
460459

461460
/* dequeue is not valid, we print a debug message there: */

kernel/sched/rt.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2431,7 +2431,6 @@ static unsigned int get_rr_interval_rt(struct rq *rq, struct task_struct *task)
24312431

24322432
const struct sched_class rt_sched_class
24332433
__attribute__((section("__rt_sched_class"))) = {
2434-
.next = &fair_sched_class,
24352434
.enqueue_task = enqueue_task_rt,
24362435
.dequeue_task = dequeue_task_rt,
24372436
.yield_task = yield_task_rt,

kernel/sched/sched.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1754,7 +1754,6 @@ extern const u32 sched_prio_to_wmult[40];
17541754
#define RETRY_TASK ((void *)-1UL)
17551755

17561756
struct sched_class {
1757-
const struct sched_class *next;
17581757

17591758
#ifdef CONFIG_UCLAMP_TASK
17601759
int uclamp_enabled;

kernel/sched/stop_task.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,6 @@ static void update_curr_stop(struct rq *rq)
111111
*/
112112
const struct sched_class stop_sched_class
113113
__attribute__((section("__stop_sched_class"))) = {
114-
.next = &dl_sched_class,
115114

116115
.enqueue_task = enqueue_task_stop,
117116
.dequeue_task = dequeue_task_stop,

0 commit comments

Comments
 (0)