aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/sched.h
diff options
context:
space:
mode:
authorLi Zefan <lizf@cn.fujitsu.com>2008-10-22 03:25:26 -0400
committerIngo Molnar <mingo@elte.hu>2008-10-22 04:01:52 -0400
commit4ce72a2c063a7fa8e42a9435440ae3364115a58d (patch)
tree427b25960945524a205c7d8ed20ed5f02325175e /include/linux/sched.h
parent0c4b83da58ec2e96ce9c44c211d6eac5f9dae478 (diff)
sched: add CONFIG_SMP consistency
a patch from Henrik Austad did this: >> Do not declare select_task_rq as part of sched_class when CONFIG_SMP is >> not set. Peter observed: > While a proper cleanup, could you do it by re-arranging the methods so > as to not create an additional ifdef? Do not declare select_task_rq and some other methods as part of sched_class when CONFIG_SMP is not set. Also gather those methods to avoid CONFIG_SMP mess. Idea-by: Henrik Austad <henrik.austad@gmail.com> Signed-off-by: Li Zefan <lizf@cn.fujitsu.com> Acked-by: Peter Zijlstra <peterz@infradead.org> Acked-by: Henrik Austad <henrik@austad.us> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include/linux/sched.h')
-rw-r--r--include/linux/sched.h12
1 files changed, 7 insertions, 5 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 4f59c8e8597d..c05b45faef18 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -897,7 +897,6 @@ struct sched_class {
897 void (*enqueue_task) (struct rq *rq, struct task_struct *p, int wakeup); 897 void (*enqueue_task) (struct rq *rq, struct task_struct *p, int wakeup);
898 void (*dequeue_task) (struct rq *rq, struct task_struct *p, int sleep); 898 void (*dequeue_task) (struct rq *rq, struct task_struct *p, int sleep);
899 void (*yield_task) (struct rq *rq); 899 void (*yield_task) (struct rq *rq);
900 int (*select_task_rq)(struct task_struct *p, int sync);
901 900
902 void (*check_preempt_curr) (struct rq *rq, struct task_struct *p, int sync); 901 void (*check_preempt_curr) (struct rq *rq, struct task_struct *p, int sync);
903 902
@@ -905,6 +904,8 @@ struct sched_class {
905 void (*put_prev_task) (struct rq *rq, struct task_struct *p); 904 void (*put_prev_task) (struct rq *rq, struct task_struct *p);
906 905
907#ifdef CONFIG_SMP 906#ifdef CONFIG_SMP
907 int (*select_task_rq)(struct task_struct *p, int sync);
908
908 unsigned long (*load_balance) (struct rq *this_rq, int this_cpu, 909 unsigned long (*load_balance) (struct rq *this_rq, int this_cpu,
909 struct rq *busiest, unsigned long max_load_move, 910 struct rq *busiest, unsigned long max_load_move,
910 struct sched_domain *sd, enum cpu_idle_type idle, 911 struct sched_domain *sd, enum cpu_idle_type idle,
@@ -916,16 +917,17 @@ struct sched_class {
916 void (*pre_schedule) (struct rq *this_rq, struct task_struct *task); 917 void (*pre_schedule) (struct rq *this_rq, struct task_struct *task);
917 void (*post_schedule) (struct rq *this_rq); 918 void (*post_schedule) (struct rq *this_rq);
918 void (*task_wake_up) (struct rq *this_rq, struct task_struct *task); 919 void (*task_wake_up) (struct rq *this_rq, struct task_struct *task);
919#endif
920 920
921 void (*set_curr_task) (struct rq *rq);
922 void (*task_tick) (struct rq *rq, struct task_struct *p, int queued);
923 void (*task_new) (struct rq *rq, struct task_struct *p);
924 void (*set_cpus_allowed)(struct task_struct *p, 921 void (*set_cpus_allowed)(struct task_struct *p,
925 const cpumask_t *newmask); 922 const cpumask_t *newmask);
926 923
927 void (*rq_online)(struct rq *rq); 924 void (*rq_online)(struct rq *rq);
928 void (*rq_offline)(struct rq *rq); 925 void (*rq_offline)(struct rq *rq);
926#endif
927
928 void (*set_curr_task) (struct rq *rq);
929 void (*task_tick) (struct rq *rq, struct task_struct *p, int queued);
930 void (*task_new) (struct rq *rq, struct task_struct *p);
929 931
930 void (*switched_from) (struct rq *this_rq, struct task_struct *task, 932 void (*switched_from) (struct rq *this_rq, struct task_struct *task,
931 int running); 933 int running);