aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/sched.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2007-10-15 11:00:12 -0400
committerIngo Molnar <mingo@elte.hu>2007-10-15 11:00:12 -0400
commit5522d5d5f70005faeffff3ffc0cfa8eec0155de4 (patch)
treed05fc41d19b8a70102a0ad3ad7ed8f6fd2d1cf7d /kernel/sched.c
parentb9fa3df33f9166daf81bfa8253d339f5a7726122 (diff)
sched: mark scheduling classes as const
mark scheduling classes as const. The speeds up the code a bit and shrinks it: text data bss dec hex filename 40027 4018 292 44337 ad31 sched.o.before 40190 3842 292 44324 ad24 sched.o.after Signed-off-by: Ingo Molnar <mingo@elte.hu> Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'kernel/sched.c')
-rw-r--r--kernel/sched.c17
1 files changed, 5 insertions, 12 deletions
diff --git a/kernel/sched.c b/kernel/sched.c
index e1657e0c86d0..f582e2cedb09 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -847,9 +847,9 @@ static int balance_tasks(struct rq *this_rq, int this_cpu, struct rq *busiest,
847 int *this_best_prio, struct rq_iterator *iterator); 847 int *this_best_prio, struct rq_iterator *iterator);
848 848
849#include "sched_stats.h" 849#include "sched_stats.h"
850#include "sched_rt.c"
851#include "sched_fair.c"
852#include "sched_idletask.c" 850#include "sched_idletask.c"
851#include "sched_fair.c"
852#include "sched_rt.c"
853#ifdef CONFIG_SCHED_DEBUG 853#ifdef CONFIG_SCHED_DEBUG
854# include "sched_debug.c" 854# include "sched_debug.c"
855#endif 855#endif
@@ -2251,7 +2251,7 @@ static int move_tasks(struct rq *this_rq, int this_cpu, struct rq *busiest,
2251 struct sched_domain *sd, enum cpu_idle_type idle, 2251 struct sched_domain *sd, enum cpu_idle_type idle,
2252 int *all_pinned) 2252 int *all_pinned)
2253{ 2253{
2254 struct sched_class *class = sched_class_highest; 2254 const struct sched_class *class = sched_class_highest;
2255 unsigned long total_load_moved = 0; 2255 unsigned long total_load_moved = 0;
2256 int this_best_prio = this_rq->curr->prio; 2256 int this_best_prio = this_rq->curr->prio;
2257 2257
@@ -2276,7 +2276,7 @@ static int move_tasks(struct rq *this_rq, int this_cpu, struct rq *busiest,
2276static int move_one_task(struct rq *this_rq, int this_cpu, struct rq *busiest, 2276static int move_one_task(struct rq *this_rq, int this_cpu, struct rq *busiest,
2277 struct sched_domain *sd, enum cpu_idle_type idle) 2277 struct sched_domain *sd, enum cpu_idle_type idle)
2278{ 2278{
2279 struct sched_class *class; 2279 const struct sched_class *class;
2280 int this_best_prio = MAX_PRIO; 2280 int this_best_prio = MAX_PRIO;
2281 2281
2282 for (class = sched_class_highest; class; class = class->next) 2282 for (class = sched_class_highest; class; class = class->next)
@@ -3432,7 +3432,7 @@ static inline void schedule_debug(struct task_struct *prev)
3432static inline struct task_struct * 3432static inline struct task_struct *
3433pick_next_task(struct rq *rq, struct task_struct *prev) 3433pick_next_task(struct rq *rq, struct task_struct *prev)
3434{ 3434{
3435 struct sched_class *class; 3435 const struct sched_class *class;
3436 struct task_struct *p; 3436 struct task_struct *p;
3437 3437
3438 /* 3438 /*
@@ -6504,13 +6504,6 @@ void __init sched_init(void)
6504 int highest_cpu = 0; 6504 int highest_cpu = 0;
6505 int i, j; 6505 int i, j;
6506 6506
6507 /*
6508 * Link up the scheduling class hierarchy:
6509 */
6510 rt_sched_class.next = &fair_sched_class;
6511 fair_sched_class.next = &idle_sched_class;
6512 idle_sched_class.next = NULL;
6513
6514 for_each_possible_cpu(i) { 6507 for_each_possible_cpu(i) {
6515 struct rt_prio_array *array; 6508 struct rt_prio_array *array;
6516 struct rq *rq; 6509 struct rq *rq;