|
@@ -111,51 +111,38 @@ extern struct sched_class fair_sched_class;
|
|
* CFS operations on generic schedulable entities:
|
|
* CFS operations on generic schedulable entities:
|
|
*/
|
|
*/
|
|
|
|
|
|
-#ifdef CONFIG_FAIR_GROUP_SCHED
|
|
|
|
-
|
|
|
|
-/* cpu runqueue to which this cfs_rq is attached */
|
|
|
|
-static inline struct rq *rq_of(struct cfs_rq *cfs_rq)
|
|
|
|
-{
|
|
|
|
- return cfs_rq->rq;
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
/* currently running entity (if any) on this cfs_rq */
|
|
/* currently running entity (if any) on this cfs_rq */
|
|
static inline struct sched_entity *cfs_rq_curr(struct cfs_rq *cfs_rq)
|
|
static inline struct sched_entity *cfs_rq_curr(struct cfs_rq *cfs_rq)
|
|
{
|
|
{
|
|
return cfs_rq->curr;
|
|
return cfs_rq->curr;
|
|
}
|
|
}
|
|
|
|
|
|
-/* An entity is a task if it doesn't "own" a runqueue */
|
|
|
|
-#define entity_is_task(se) (!se->my_q)
|
|
|
|
-
|
|
|
|
static inline void
|
|
static inline void
|
|
set_cfs_rq_curr(struct cfs_rq *cfs_rq, struct sched_entity *se)
|
|
set_cfs_rq_curr(struct cfs_rq *cfs_rq, struct sched_entity *se)
|
|
{
|
|
{
|
|
cfs_rq->curr = se;
|
|
cfs_rq->curr = se;
|
|
}
|
|
}
|
|
|
|
|
|
-#else /* CONFIG_FAIR_GROUP_SCHED */
|
|
|
|
|
|
+#ifdef CONFIG_FAIR_GROUP_SCHED
|
|
|
|
|
|
|
|
+/* cpu runqueue to which this cfs_rq is attached */
|
|
static inline struct rq *rq_of(struct cfs_rq *cfs_rq)
|
|
static inline struct rq *rq_of(struct cfs_rq *cfs_rq)
|
|
{
|
|
{
|
|
- return container_of(cfs_rq, struct rq, cfs);
|
|
|
|
|
|
+ return cfs_rq->rq;
|
|
}
|
|
}
|
|
|
|
|
|
-static inline struct sched_entity *cfs_rq_curr(struct cfs_rq *cfs_rq)
|
|
|
|
-{
|
|
|
|
- struct rq *rq = rq_of(cfs_rq);
|
|
|
|
|
|
+/* An entity is a task if it doesn't "own" a runqueue */
|
|
|
|
+#define entity_is_task(se) (!se->my_q)
|
|
|
|
|
|
- if (unlikely(rq->curr->sched_class != &fair_sched_class))
|
|
|
|
- return NULL;
|
|
|
|
|
|
+#else /* CONFIG_FAIR_GROUP_SCHED */
|
|
|
|
|
|
- return &rq->curr->se;
|
|
|
|
|
|
+static inline struct rq *rq_of(struct cfs_rq *cfs_rq)
|
|
|
|
+{
|
|
|
|
+ return container_of(cfs_rq, struct rq, cfs);
|
|
}
|
|
}
|
|
|
|
|
|
#define entity_is_task(se) 1
|
|
#define entity_is_task(se) 1
|
|
|
|
|
|
-static inline void
|
|
|
|
-set_cfs_rq_curr(struct cfs_rq *cfs_rq, struct sched_entity *se) { }
|
|
|
|
-
|
|
|
|
#endif /* CONFIG_FAIR_GROUP_SCHED */
|
|
#endif /* CONFIG_FAIR_GROUP_SCHED */
|
|
|
|
|
|
static inline struct task_struct *task_of(struct sched_entity *se)
|
|
static inline struct task_struct *task_of(struct sched_entity *se)
|