• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-WNDR4500v2-V1.0.0.60_1.0.38/src/linux/linux-2.6/kernel/

Lines Matching refs:se

97 #define entity_is_task(se)	(!se->my_q)
106 #define entity_is_task(se) 1
110 static inline struct task_struct *task_of(struct sched_entity *se)
112 return container_of(se, struct task_struct, se);
138 static inline s64 entity_key(struct cfs_rq *cfs_rq, struct sched_entity *se)
140 return se->vruntime - cfs_rq->min_vruntime;
146 static void __enqueue_entity(struct cfs_rq *cfs_rq, struct sched_entity *se)
151 s64 key = entity_key(cfs_rq, se);
177 cfs_rq->rb_leftmost = &se->run_node;
179 rb_link_node(&se->run_node, parent, link);
180 rb_insert_color(&se->run_node, &cfs_rq->tasks_timeline);
183 static void __dequeue_entity(struct cfs_rq *cfs_rq, struct sched_entity *se)
185 if (cfs_rq->rb_leftmost == &se->run_node)
186 cfs_rq->rb_leftmost = rb_next(&se->run_node);
188 rb_erase(&se->run_node, &cfs_rq->tasks_timeline);
204 struct sched_entity *se = NULL;
209 se = rb_entry(parent, struct sched_entity, run_node);
213 return se;
264 static u64 sched_slice(struct cfs_rq *cfs_rq, struct sched_entity *se)
268 slice *= se->load.weight;
294 static u64 sched_vslice_add(struct cfs_rq *cfs_rq, struct sched_entity *se)
296 return __sched_vslice(cfs_rq->load.weight + se->load.weight,
363 update_stats_wait_start(struct cfs_rq *cfs_rq, struct sched_entity *se)
365 schedstat_set(se->wait_start, rq_of(cfs_rq)->clock);
371 static void update_stats_enqueue(struct cfs_rq *cfs_rq, struct sched_entity *se)
377 if (se != cfs_rq->curr)
378 update_stats_wait_start(cfs_rq, se);
382 update_stats_wait_end(struct cfs_rq *cfs_rq, struct sched_entity *se)
384 schedstat_set(se->wait_max, max(se->wait_max,
385 rq_of(cfs_rq)->clock - se->wait_start));
386 schedstat_set(se->wait_start, 0);
390 update_stats_dequeue(struct cfs_rq *cfs_rq, struct sched_entity *se)
396 if (se != cfs_rq->curr)
397 update_stats_wait_end(cfs_rq, se);
404 update_stats_curr_start(struct cfs_rq *cfs_rq, struct sched_entity *se)
409 se->exec_start = rq_of(cfs_rq)->clock;
417 account_entity_enqueue(struct cfs_rq *cfs_rq, struct sched_entity *se)
419 update_load_add(&cfs_rq->load, se->load.weight);
421 se->on_rq = 1;
425 account_entity_dequeue(struct cfs_rq *cfs_rq, struct sched_entity *se)
427 update_load_sub(&cfs_rq->load, se->load.weight);
429 se->on_rq = 0;
432 static void enqueue_sleeper(struct cfs_rq *cfs_rq, struct sched_entity *se)
435 if (se->sleep_start) {
436 u64 delta = rq_of(cfs_rq)->clock - se->sleep_start;
441 if (unlikely(delta > se->sleep_max))
442 se->sleep_max = delta;
444 se->sleep_start = 0;
445 se->sum_sleep_runtime += delta;
447 if (se->block_start) {
448 u64 delta = rq_of(cfs_rq)->clock - se->block_start;
453 if (unlikely(delta > se->block_max))
454 se->block_max = delta;
456 se->block_start = 0;
457 se->sum_sleep_runtime += delta;
465 struct task_struct *tsk = task_of(se);
474 static void check_spread(struct cfs_rq *cfs_rq, struct sched_entity *se)
477 s64 d = se->vruntime - cfs_rq->min_vruntime;
488 place_entity(struct cfs_rq *cfs_rq, struct sched_entity *se, int initial)
510 vruntime += sched_vslice_add(cfs_rq, se);
514 if (sched_feat(NEW_FAIR_SLEEPERS) && entity_is_task(se))
518 vruntime = max_vruntime(se->vruntime, vruntime);
521 se->vruntime = vruntime;
525 enqueue_entity(struct cfs_rq *cfs_rq, struct sched_entity *se, int wakeup)
533 place_entity(cfs_rq, se, 0);
534 enqueue_sleeper(cfs_rq, se);
537 update_stats_enqueue(cfs_rq, se);
538 check_spread(cfs_rq, se);
539 if (se != cfs_rq->curr)
540 __enqueue_entity(cfs_rq, se);
541 account_entity_enqueue(cfs_rq, se);
545 dequeue_entity(struct cfs_rq *cfs_rq, struct sched_entity *se, int sleep)
552 update_stats_dequeue(cfs_rq, se);
555 if (entity_is_task(se)) {
556 struct task_struct *tsk = task_of(se);
559 se->sleep_start = rq_of(cfs_rq)->clock;
561 se->block_start = rq_of(cfs_rq)->clock;
566 if (se != cfs_rq->curr)
567 __dequeue_entity(cfs_rq, se);
568 account_entity_dequeue(cfs_rq, se);
586 set_next_entity(struct cfs_rq *cfs_rq, struct sched_entity *se)
589 if (se->on_rq) {
595 update_stats_wait_end(cfs_rq, se);
596 __dequeue_entity(cfs_rq, se);
599 update_stats_curr_start(cfs_rq, se);
600 cfs_rq->curr = se;
607 if (rq_of(cfs_rq)->load.weight >= 2*se->load.weight) {
608 se->slice_max = max(se->slice_max,
609 se->sum_exec_runtime - se->prev_sum_exec_runtime);
612 se->prev_sum_exec_runtime = se->sum_exec_runtime;
617 struct sched_entity *se = NULL;
620 se = __pick_next_entity(cfs_rq);
621 set_next_entity(cfs_rq, se);
624 return se;
663 #define for_each_sched_entity(se) \
664 for (; se; se = se->parent)
668 return p->se.cfs_rq;
672 static inline struct cfs_rq *cfs_rq_of(struct sched_entity *se)
674 return se->cfs_rq;
697 is_same_group(struct sched_entity *se, struct sched_entity *pse)
699 if (se->cfs_rq == pse->cfs_rq)
705 static inline struct sched_entity *parent_entity(struct sched_entity *se)
707 return se->parent;
712 #define for_each_sched_entity(se) \
713 for (; se; se = NULL)
720 static inline struct cfs_rq *cfs_rq_of(struct sched_entity *se)
722 struct task_struct *p = task_of(se);
743 is_same_group(struct sched_entity *se, struct sched_entity *pse)
748 static inline struct sched_entity *parent_entity(struct sched_entity *se)
763 struct sched_entity *se = &p->se;
765 for_each_sched_entity(se) {
766 if (se->on_rq)
768 cfs_rq = cfs_rq_of(se);
769 enqueue_entity(cfs_rq, se, wakeup);
782 struct sched_entity *se = &p->se;
784 for_each_sched_entity(se) {
785 cfs_rq = cfs_rq_of(se);
786 dequeue_entity(cfs_rq, se, sleep);
803 struct sched_entity *rightmost, *se = &curr->se;
827 if (unlikely(rightmost->vruntime < se->vruntime))
835 se->vruntime = rightmost->vruntime + 1;
845 struct sched_entity *se = &curr->se, *pse = &p->se;
864 while (!is_same_group(se, pse)) {
865 se = parent_entity(se);
870 if (unlikely(se->load.weight != NICE_0_LOAD))
871 gran = calc_delta_fair(gran, &se->load);
873 if (pse->vruntime + gran < se->vruntime)
880 struct sched_entity *se;
886 se = pick_next_entity(cfs_rq);
887 cfs_rq = group_cfs_rq(se);
890 return task_of(se);
898 struct sched_entity *se = &prev->se;
901 for_each_sched_entity(se) {
902 cfs_rq = cfs_rq_of(se);
903 put_prev_entity(cfs_rq, se);
927 p = rb_entry(curr, struct task_struct, se.run_node);
1048 struct sched_entity *se = &curr->se;
1050 for_each_sched_entity(se) {
1051 cfs_rq = cfs_rq_of(se);
1052 entity_tick(cfs_rq, se);
1068 struct sched_entity *se = &p->se, *curr = cfs_rq->curr;
1074 place_entity(cfs_rq, se, 1);
1078 curr && curr->vruntime < se->vruntime) {
1083 swap(curr->vruntime, se->vruntime);
1097 struct sched_entity *se = &rq->curr->se;
1099 for_each_sched_entity(se)
1100 set_next_entity(cfs_rq_of(se), se);