diff options
author | Li Zefan <lizefan@huawei.com> | 2013-03-05 03:06:55 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2013-03-06 05:24:33 -0500 |
commit | c82ba9fa7588dfd02d4dc99ad1af486304bc424c (patch) | |
tree | 870cdeaa3aad811645cce93b1c15646ed4b9f133 | |
parent | b13095f07f25464de65f5ce5ea94e16813d67488 (diff) |
sched: Move struct sched_class to kernel/sched/sched.h
It's used internally only.
Signed-off-by: Li Zefan <lizefan@huawei.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/5135A79F.8090502@huawei.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
-rw-r--r-- | include/linux/sched.h | 59 | ||||
-rw-r--r-- | kernel/sched/sched.h | 55 |
2 files changed, 55 insertions, 59 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h index 863b505ac48e..04b834fa14bc 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -917,65 +917,6 @@ struct mempolicy; | |||
917 | struct pipe_inode_info; | 917 | struct pipe_inode_info; |
918 | struct uts_namespace; | 918 | struct uts_namespace; |
919 | 919 | ||
920 | struct rq; | ||
921 | struct sched_domain; | ||
922 | |||
923 | #define ENQUEUE_WAKEUP 1 | ||
924 | #define ENQUEUE_HEAD 2 | ||
925 | #ifdef CONFIG_SMP | ||
926 | #define ENQUEUE_WAKING 4 /* sched_class::task_waking was called */ | ||
927 | #else | ||
928 | #define ENQUEUE_WAKING 0 | ||
929 | #endif | ||
930 | |||
931 | #define DEQUEUE_SLEEP 1 | ||
932 | |||
933 | struct sched_class { | ||
934 | const struct sched_class *next; | ||
935 | |||
936 | void (*enqueue_task) (struct rq *rq, struct task_struct *p, int flags); | ||
937 | void (*dequeue_task) (struct rq *rq, struct task_struct *p, int flags); | ||
938 | void (*yield_task) (struct rq *rq); | ||
939 | bool (*yield_to_task) (struct rq *rq, struct task_struct *p, bool preempt); | ||
940 | |||
941 | void (*check_preempt_curr) (struct rq *rq, struct task_struct *p, int flags); | ||
942 | |||
943 | struct task_struct * (*pick_next_task) (struct rq *rq); | ||
944 | void (*put_prev_task) (struct rq *rq, struct task_struct *p); | ||
945 | |||
946 | #ifdef CONFIG_SMP | ||
947 | int (*select_task_rq)(struct task_struct *p, int sd_flag, int flags); | ||
948 | void (*migrate_task_rq)(struct task_struct *p, int next_cpu); | ||
949 | |||
950 | void (*pre_schedule) (struct rq *this_rq, struct task_struct *task); | ||
951 | void (*post_schedule) (struct rq *this_rq); | ||
952 | void (*task_waking) (struct task_struct *task); | ||
953 | void (*task_woken) (struct rq *this_rq, struct task_struct *task); | ||
954 | |||
955 | void (*set_cpus_allowed)(struct task_struct *p, | ||
956 | const struct cpumask *newmask); | ||
957 | |||
958 | void (*rq_online)(struct rq *rq); | ||
959 | void (*rq_offline)(struct rq *rq); | ||
960 | #endif | ||
961 | |||
962 | void (*set_curr_task) (struct rq *rq); | ||
963 | void (*task_tick) (struct rq *rq, struct task_struct *p, int queued); | ||
964 | void (*task_fork) (struct task_struct *p); | ||
965 | |||
966 | void (*switched_from) (struct rq *this_rq, struct task_struct *task); | ||
967 | void (*switched_to) (struct rq *this_rq, struct task_struct *task); | ||
968 | void (*prio_changed) (struct rq *this_rq, struct task_struct *task, | ||
969 | int oldprio); | ||
970 | |||
971 | unsigned int (*get_rr_interval) (struct rq *rq, | ||
972 | struct task_struct *task); | ||
973 | |||
974 | #ifdef CONFIG_FAIR_GROUP_SCHED | ||
975 | void (*task_move_group) (struct task_struct *p, int on_rq); | ||
976 | #endif | ||
977 | }; | ||
978 | |||
979 | struct load_weight { | 920 | struct load_weight { |
980 | unsigned long weight, inv_weight; | 921 | unsigned long weight, inv_weight; |
981 | }; | 922 | }; |
diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h index 4e5c2afdac91..eca526d7afbd 100644 --- a/kernel/sched/sched.h +++ b/kernel/sched/sched.h | |||
@@ -951,6 +951,61 @@ enum cpuacct_stat_index { | |||
951 | CPUACCT_STAT_NSTATS, | 951 | CPUACCT_STAT_NSTATS, |
952 | }; | 952 | }; |
953 | 953 | ||
954 | #define ENQUEUE_WAKEUP 1 | ||
955 | #define ENQUEUE_HEAD 2 | ||
956 | #ifdef CONFIG_SMP | ||
957 | #define ENQUEUE_WAKING 4 /* sched_class::task_waking was called */ | ||
958 | #else | ||
959 | #define ENQUEUE_WAKING 0 | ||
960 | #endif | ||
961 | |||
962 | #define DEQUEUE_SLEEP 1 | ||
963 | |||
964 | struct sched_class { | ||
965 | const struct sched_class *next; | ||
966 | |||
967 | void (*enqueue_task) (struct rq *rq, struct task_struct *p, int flags); | ||
968 | void (*dequeue_task) (struct rq *rq, struct task_struct *p, int flags); | ||
969 | void (*yield_task) (struct rq *rq); | ||
970 | bool (*yield_to_task) (struct rq *rq, struct task_struct *p, bool preempt); | ||
971 | |||
972 | void (*check_preempt_curr) (struct rq *rq, struct task_struct *p, int flags); | ||
973 | |||
974 | struct task_struct * (*pick_next_task) (struct rq *rq); | ||
975 | void (*put_prev_task) (struct rq *rq, struct task_struct *p); | ||
976 | |||
977 | #ifdef CONFIG_SMP | ||
978 | int (*select_task_rq)(struct task_struct *p, int sd_flag, int flags); | ||
979 | void (*migrate_task_rq)(struct task_struct *p, int next_cpu); | ||
980 | |||
981 | void (*pre_schedule) (struct rq *this_rq, struct task_struct *task); | ||
982 | void (*post_schedule) (struct rq *this_rq); | ||
983 | void (*task_waking) (struct task_struct *task); | ||
984 | void (*task_woken) (struct rq *this_rq, struct task_struct *task); | ||
985 | |||
986 | void (*set_cpus_allowed)(struct task_struct *p, | ||
987 | const struct cpumask *newmask); | ||
988 | |||
989 | void (*rq_online)(struct rq *rq); | ||
990 | void (*rq_offline)(struct rq *rq); | ||
991 | #endif | ||
992 | |||
993 | void (*set_curr_task) (struct rq *rq); | ||
994 | void (*task_tick) (struct rq *rq, struct task_struct *p, int queued); | ||
995 | void (*task_fork) (struct task_struct *p); | ||
996 | |||
997 | void (*switched_from) (struct rq *this_rq, struct task_struct *task); | ||
998 | void (*switched_to) (struct rq *this_rq, struct task_struct *task); | ||
999 | void (*prio_changed) (struct rq *this_rq, struct task_struct *task, | ||
1000 | int oldprio); | ||
1001 | |||
1002 | unsigned int (*get_rr_interval) (struct rq *rq, | ||
1003 | struct task_struct *task); | ||
1004 | |||
1005 | #ifdef CONFIG_FAIR_GROUP_SCHED | ||
1006 | void (*task_move_group) (struct task_struct *p, int on_rq); | ||
1007 | #endif | ||
1008 | }; | ||
954 | 1009 | ||
955 | #define sched_class_highest (&stop_sched_class) | 1010 | #define sched_class_highest (&stop_sched_class) |
956 | #define for_each_class(class) \ | 1011 | #define for_each_class(class) \ |