diff options
Diffstat (limited to 'kernel/sched_fair.c')
-rw-r--r-- | kernel/sched_fair.c | 31 |
1 files changed, 9 insertions, 22 deletions
diff --git a/kernel/sched_fair.c b/kernel/sched_fair.c index 105d57b41aa2..335faf06a561 100644 --- a/kernel/sched_fair.c +++ b/kernel/sched_fair.c | |||
@@ -111,51 +111,38 @@ extern struct sched_class fair_sched_class; | |||
111 | * CFS operations on generic schedulable entities: | 111 | * CFS operations on generic schedulable entities: |
112 | */ | 112 | */ |
113 | 113 | ||
114 | #ifdef CONFIG_FAIR_GROUP_SCHED | ||
115 | |||
116 | /* cpu runqueue to which this cfs_rq is attached */ | ||
117 | static inline struct rq *rq_of(struct cfs_rq *cfs_rq) | ||
118 | { | ||
119 | return cfs_rq->rq; | ||
120 | } | ||
121 | |||
122 | /* currently running entity (if any) on this cfs_rq */ | 114 | /* currently running entity (if any) on this cfs_rq */ |
123 | static inline struct sched_entity *cfs_rq_curr(struct cfs_rq *cfs_rq) | 115 | static inline struct sched_entity *cfs_rq_curr(struct cfs_rq *cfs_rq) |
124 | { | 116 | { |
125 | return cfs_rq->curr; | 117 | return cfs_rq->curr; |
126 | } | 118 | } |
127 | 119 | ||
128 | /* An entity is a task if it doesn't "own" a runqueue */ | ||
129 | #define entity_is_task(se) (!se->my_q) | ||
130 | |||
131 | static inline void | 120 | static inline void |
132 | set_cfs_rq_curr(struct cfs_rq *cfs_rq, struct sched_entity *se) | 121 | set_cfs_rq_curr(struct cfs_rq *cfs_rq, struct sched_entity *se) |
133 | { | 122 | { |
134 | cfs_rq->curr = se; | 123 | cfs_rq->curr = se; |
135 | } | 124 | } |
136 | 125 | ||
137 | #else /* CONFIG_FAIR_GROUP_SCHED */ | 126 | #ifdef CONFIG_FAIR_GROUP_SCHED |
138 | 127 | ||
128 | /* cpu runqueue to which this cfs_rq is attached */ | ||
139 | static inline struct rq *rq_of(struct cfs_rq *cfs_rq) | 129 | static inline struct rq *rq_of(struct cfs_rq *cfs_rq) |
140 | { | 130 | { |
141 | return container_of(cfs_rq, struct rq, cfs); | 131 | return cfs_rq->rq; |
142 | } | 132 | } |
143 | 133 | ||
144 | static inline struct sched_entity *cfs_rq_curr(struct cfs_rq *cfs_rq) | 134 | /* An entity is a task if it doesn't "own" a runqueue */ |
145 | { | 135 | #define entity_is_task(se) (!se->my_q) |
146 | struct rq *rq = rq_of(cfs_rq); | ||
147 | 136 | ||
148 | if (unlikely(rq->curr->sched_class != &fair_sched_class)) | 137 | #else /* CONFIG_FAIR_GROUP_SCHED */ |
149 | return NULL; | ||
150 | 138 | ||
151 | return &rq->curr->se; | 139 | static inline struct rq *rq_of(struct cfs_rq *cfs_rq) |
140 | { | ||
141 | return container_of(cfs_rq, struct rq, cfs); | ||
152 | } | 142 | } |
153 | 143 | ||
154 | #define entity_is_task(se) 1 | 144 | #define entity_is_task(se) 1 |
155 | 145 | ||
156 | static inline void | ||
157 | set_cfs_rq_curr(struct cfs_rq *cfs_rq, struct sched_entity *se) { } | ||
158 | |||
159 | #endif /* CONFIG_FAIR_GROUP_SCHED */ | 146 | #endif /* CONFIG_FAIR_GROUP_SCHED */ |
160 | 147 | ||
161 | static inline struct task_struct *task_of(struct sched_entity *se) | 148 | static inline struct task_struct *task_of(struct sched_entity *se) |