1 2 3 4 5 6 7 8 | struct task_struct { /* Defined in 2.6.23:/usr/include/linux/sched.h */ .... - struct prio_array *array; + struct sched_entity se; + struct sched_class *sched_class; .... .... }; |
1 2 3 4 5 6 7 8 9 | struct sched_entity { /* Defined in 2.6.23:/usr/include/linux/sched.h */ long wait_runtime; /* Amount of time the entity must run to become completely */ /* fair and balanced.*/ s64 fair_key; struct load_weight load; /* for load-balancing */ struct rb_node run_node; /* To be part of Red-black tree data structure */ unsigned int on_rq; .... }; |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | struct sched_class { /* Defined in 2.6.23:/usr/include/linux/sched.h */ struct sched_class *next; void (*enqueue_task) (struct rq *rq, struct task_struct *p, int wakeup); void (*dequeue_task) (struct rq *rq, struct task_struct *p, int sleep); void (*yield_task) (struct rq *rq, struct task_struct *p); void (*check_preempt_curr) (struct rq *rq, struct task_struct *p); struct task_struct * (*pick_next_task) (struct rq *rq); void (*put_prev_task) (struct rq *rq, struct task_struct *p); unsigned long (*load_balance) (struct rq *this_rq, int this_cpu, struct rq *busiest, unsigned long max_nr_move, unsigned long max_load_move, struct sched_domain *sd, enum cpu_idle_type idle, int *all_pinned, int *this_best_prio); void (*set_curr_task) (struct rq *rq); void (*task_tick) (struct rq *rq, struct task_struct *p); void (*task_new) (struct rq *rq, struct task_struct *p); }; |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | struct cfs_rq {/* Defined in 2.6.23:kernel/sched.c */ struct load_weight load; unsigned long nr_running; s64 fair_clock; /* runqueue wide global clock */ u64 exec_clock; s64 wait_runtime; u64 sleeper_bonus; unsigned long wait_runtime_overruns, wait_runtime_underruns; struct rb_root tasks_timeline; /* Points to the root of the rb-tree*/ struct rb_node *rb_leftmost; /* Points to most eligible task to give the CPU */ struct rb_node *rb_load_balance_curr; #ifdef CONFIG_FAIR_GROUP_SCHED struct sched_entity *curr; /* Currently running entity */ struct rq *rq; /* cpu runqueue to which this cfs_rq is attached */ ... ... #endif }; |
欢迎光临 电子技术论坛_中国专业的电子工程师学习交流社区-中电网技术论坛 (http://bbs.eccn.com/) | Powered by Discuz! 7.0.0 |